Python Tuple

0

Python Tuple

  • A tuple is a sequence of immutable Python objects.

  • Tuple is a also a collection of heterogeneous objects where insertion order is preserved and duplicates are allowed.

  • Tuple also stores the elements on the basis of index only.

When to use a Tuple.

  • Duplicates and insertion order preserved.

  • Not editable.

Ways to create a Tuple.

  • ts = ( )                #Blank Tuple

  • ts = tuple( )       #Blank Tuple 


 


 

Tags

Post a Comment

0Comments
Post a Comment (0)