文章目录

  • 1、判断语句
  • 2、循环语句


1、判断语句
num = 10

if (num > 0 and num <10) :
    print ("a")

elif(num >=10 and num < 20) :
     print ("b")

else :
    print ("c")
2、循环语句
for i in [1,2,3,4,5]:
    print (i)

for i in range(6):
    print (i)
a = 3
while (a >0):
    print (a)
    a = a -1
    if (a == 2):
        break