Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This is a months tuple that contains the last months of the year
- months = ("September", "October", "November", "December")
- # This is a code to convert a list of strings to a tuple and assign it to a
- # variable
- # A variable assigned to a list of strings
- favs = ["The Gentleman", "Rough Night", "Ender's Game"]
- # This converts the list to a tuple
- print(tuple(["The Gentleman", "Rough Night", "Ender's Game"]))
- # Assigning the tuple to a variable
- movies = ("The Gentleman", "Rough Night", "Ender's Game")
- # This is a numbers tuple assigned to another tuple containing the various
- # numbers tuple
- # The various numbers tuple
- numbers_a = (1, 2, 3)
- numbers_b = (4, 5, 6)
- numbers_c = (7, 8, 9)
- # The tuple containing the various tuples
- all_numbers = (numbers_a, numbers_b, numbers_c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement