Detailed tuple in Python

definition

ps: tuples and a list of similar, can store a plurality of elements of any type, except that the elements of the tuple can not be modified, corresponding to the list of immutable, recording a constant value. Only for reading.

# Define tuples: a plurality of any type of () using comma-separated values 
Asian_countries = ( ' China ' , ' Japan ' , ' Singapore ' )
 # If only one value tuple, must keep behind the comma, otherwise only considered include the relationship, rather than a tuple. 
= Asian_countries ( ' China ' ,)
 # Asian_countries = ( 'China') 
Print (Asian_countries)

 

Guess you like

Origin www.cnblogs.com/Ghostant/p/11778658.html