+ 2

What are tuples??

8th Dec 2016, 5:27 PM
abhi
2 Answers
+ 4
Basically a list but you can't edit it after creation. You work with them in the same way as you would with lists. Also they are much faster. >>>mytuple = ("value1", 2, False) >>>print(mytuple[0]) value1
8th Dec 2016, 11:10 PM
Leon N.
Leon N. - avatar
+ 2
tuples are immutable lists. so if you don't want to edit a list after creation, use a tuple instead because tuples are faster. one use of it can be as keys for dictionaries, because dictionary keys should be immutable. in functional programming, tuples are preferred over lists because in purely functional programming, all variables are immutable.
26th Jan 2017, 9:39 AM
pravees ivanovich