Discuss / Python / 怎么让程序把条件都判断完?

怎么让程序把条件都判断完?

Topic source

age = 20 if age >= 6: print('teenager') elif age >= 18: print('adult') else: print('kid')

如果我想要上面的程序不停在if,继续往下走怎么办呢?做个循环码?
age = 20
if age >= 6:
    print('teenager')
    if age >= 18:
        print('adult')
        if age >= 0
               print('kid')

  • 1

Reply