+ 4
Tuples versus Constant Variable
what is the different between the two
2 ответов
+ 4
both are mutable in a sense that they can't be changes once set, so is the any difference or just different wording in two different languages
0
A tuple is immutable, but it also is a sequence and can therefore contain more than one element. Moreover, the elements of a tuple do not need to be of the same type:
stuff = ('one', 2, 3.0, {'place': 'here', 'time': 'now'})
print(stuff[3]['time'])