Last active
March 19, 2023 18:45
-
-
Save ozgurozkok/a4f0d5ca7dfc072da87436d9b32c872d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sample 1 | |
#Here's an example of creating a tuple | |
my_tuple = (1, 2, 3, "four", 5.0) | |
#sample 2 | |
#Tuples can also be created without using parentheses, using just commas: | |
another_tuple = "one", "two", "three" | |
#sample 3 | |
#Here's an example that could produce this error message: | |
my_tuple = (1, 2, 3) | |
value = my_tuple.get(0) | |
#sample 4 | |
#This code will retrieve the value at index 0 of the my_tuple tuple, which is 1. | |
my_tuple = (1, 2, 3) | |
value = my_tuple[0] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment