python 3 if else 多重判

发布时间:2019-09-24 08:34:21编辑:auto阅读(1987)

    # -*- coding:utf-8 -*-  
    Man = 27
    guess_age_of_people = int (input("guess age:"))
    #python 3.x 默认变量类型为字符串,数字需要应int () 方式进行×××
    if guess_age_of_people == Man :
        print("It is true!")
    elif guess_age_of_people > Man :
        print("It is bigger!")
    else:
        print("It is small!")


关键字