选择
n = 10
i = 2
if n == i:
print("equal")
elif n < i:
print("lower")
else:
print("higher")
遍历
while i < n:
i += 1
print(i)
else:
print("done")
for i in range(0, 5):
print(i)
else:
pass
lst = ["aa", "bb"]
for name in lst:
print(name)
tp = ("aa", "bb")
for name in tp:
print(name)
dct = {"name": "lily", "age": 19}
for key, value in dct.items():
print(key, value)
for key in dct.keys():
print(key)
for value in dct.values():
print(value)
for key in dct:
print(key, dct[key])
data = [{"lily": 5}, {"rose": 13}]
birth_data = [[value for key, value in row.items()] for row in data]
print(birth_data)
标签:name,value,控制结构,key,print,dct,data,python3 From: https://www.cnblogs.com/caroline2016/p/17956838