练习嵌套for_in_range
#!/usr/bin/env python
#-*- coding:utf-8 -*-
for x in range(5):
for y in range(5):
print(x,end="\t")
print()#换行的作用
print("=========================")
for m in range(1,10):
for n in range(1,m+1):
print("{0}*{1}={2}".format(m,n,(m*n)),end="\t")
print()#换行
print("========================================================================")
r1=dict(name="高小二",age=19,salary=30000,city="北京")
r2=dict(name="高小三",age=20,salary=20000,city="杭州")
r3=dict(name="高小四",age=21,salary=10000,city="上海")
tb=[r1,r2,r3]
for x in tb:
if x.get("salary")>15000:
print(x)
输出结果: