0
How can I obtain an item from a tuple by index??
For example in ("a", "b", "c") obtain the index 1 ("b")
2 Answers
+ 1
You can also 'dispatch' the content of a tupple in a serie of variables:
a = 0
b = 0
c = 0
a, b, c = ( 1, 2, 3)
print(str(a)+':'+str(b)+':'+str(c)) # output "1:2:3"
0
not sure your exact question but if your tuple was named myTuple then it would be myTuple[1] for example
if you coded:
myTuple = ("a", "b", "c")
myTuple[1] // would return "b"