Python: Making a Tuple

Post Reply
User avatar
Jason
Site Admin
Posts: 923
Joined: Sun Dec 21, 2025 8:56 pm

Code: Select all

# Tuples can have duplicates, are ordered, elements can't be changed.  

tuple_of_some_colors = ("red", "green", "purple", "orange", "blue")

print(tuple_of_some_colors)

# Another way to make a Tuple below

tuple_of_some_sizes = tuple(("big", "medium", "small"))
 

POSTREACT(ions) SUMMARY

Post Reply