Example
Creating Tuples
Tuples are immutable lists. Once created, they cannot be modified.
6 results
Example
Tuples are immutable lists. Once created, they cannot be modified.
Quiz
Free beginner quiz on Python tuples: 15 questions on indexing, packing and unpacking, count(), index(), slicing and nested tuples. Instant answers.
Challenge
code[0] = "X" stops with a TypeError, because Python strings can't be changed. Predict the crash, find out what methods and slices really give, build a new string instead, then swap a letter in the…
Quiz
…, tuple , dict and set , and when to use which Mutable and immutable types, and what can be a dictionary key How it works 15 questions: 11 with one correct answer, 4 where you select every correct…
Article Python Fundamentals
…464, 15, -63] # Average temperatures in Celsius Tuples Immutable sequences, useful for storing fixed data: earth_coordinates = (0, 0, 0) # x, y, z coordinates mission_details = ("Apollo 11", 1969…
Article Mini projects
…it's that programmers sometimes forget that time isn't as immutable as we'd like to believe. Building Our Space Medication Dispenser Let's create a medication dispenser that would make Dr. Ryland…