Posts

Showing posts with the label tuple function python artificialintelligence

Tuple Functions In Python

Image
  A tuple is a  sequence  of  inflexible  Python  objects . Tuples are  sequences ,  just  like lists. The main  difference  between the tuples and the lists is that the tuples can not  be   changed  unlike lists. Tuples  use   hiatuses , whereas lists  use   square   classes . Creating a tuple functions in python is as  simple  as  putting   different  comma-  separated   values .  Voluntarily , you can  put  these comma-  separated   values  between  hiatuses   also . For  illustration  − tup1 = ('physics', 'chemistry', 1997, 2000) tup2 = (1, 2, 3, 4, 5 ) tup3 = "a", "b", "c", "d" The empty tuple is written as two parentheses containing nothing − tup1 = (); To write a tuple containing a single value you have to include a comma, even though there is only one value − tup1 = (50,) Streamlining  Tuples Tuples are  inflexible , which means you can not  modernize  or  change  the  values  of tuple  rudiments . You're  suitable  t