横向输出
1、遍历字符串
2、遍历列表
3、遍历元组
方法一:
方法二:
方法三:
#循环字典:方法一
# dict1={"name":"zhihao","age":19}
# print (type(dict1))
# for i in dict1:
# print (i,dict1[i])
#循环字典:方法二
# dict1={"name":"zhihao","age":19}
# print (type(dict1))
# for k,v in dict1.items():
# print (k,v)
#循环字典:方法三
#dict1={"name":"zhihao","age":19}
# print (type(dict1))
# for i in dict1:
# print (i,dict1.get(i))