【文件属性】:
文件名称:浅谈Python基础—判断和循环
文件大小:211KB
文件格式:PDF
更新时间:2020-12-25 14:52:36
python python for循环
判断
缩进代替大括号。
冒号(:)后换号缩进。
if
test=100
if test>50:
print('OK')
print('test')
if-elif-else
test=50
if test>200:
print('200')
elif test<100:
print('100')
else:
print('100-200')
列表
test1=[123,456,789]
if 123 in test1:
print('OK')
字典
test2={'hello':123,'world':456}
if 'hello' in test2:
print('