sh_06_ use substantially tuple

 

sh_06_ use substantially tuple

= info_tuple ( " zhangsan " , 18 is, 1.75, " zhangsan " ) 

# 1. Take index values and 
Print (info_tuple [0])
 # already know the contents data, it is desirable to know that the data in the index tuple 
Print (info_tuple .index ( " zhangsan " )) 

# 2. statistics count 
Print (info_tuple.count ( " zhangsan " ))
 # statistics tuple number of elements contained 
Print (len (info_tuple))

 

Guess you like

Origin www.cnblogs.com/shaohan/p/11519349.html