Tuples

--Originally published at Hector Martinez Alcantara

The tuples are almost the same as the lists, with the diference that tuples are immutable, is means that you can’t enlarge or shorten a tuple, but you can update it.

Also the syntax of the tuples is different,if you want to create a tuple you have to use parentheses unlike lists.

The syntax is:

Tuple=("elem",2,3,"elem 4")

If you want to access it you can do the same as you do with the lists, you also have to use brackets to access a value of the tuple.

print( Tuple[2] )

The Tuples operators and indexing are also the same, if you want to know more about them, visit my last post called Lists or Tutorialspoint, there is a lot of information about these topics.

Thanks for reading, and again thanks to  Tutorialspoint where you can find a lot of information.