在python中对元祖进行遍历的方法
1.使用迭代遍历元组
info_tuple_01 = ("zhangsan",18,1.75) #创建一个元祖#使用迭代遍历元组for my_info in info_tuple_01:print(my_info)
info_tuple_01 = ("zhangsan",18,1.75) #创建一个元祖
#使用迭代遍历元组
for my_info in info_tuple_01:
print(my_info)
2.使用for循环遍历元祖
src_list = [1,22.5,3,45,'ab',78,2] #创建一个元祖for ele in range(1,len(src_list))
src_list = [1,22.5,3,45,'ab',78,2] #创建一个元祖
for ele in range(1,len(src_list))