首页 > 代码库 > if,else判断

if,else判断

Age of oldboy =56

Guess_age =int(input(“guess age:”))

If guess_age ==age_of_oldboy :

       Print(“yes,you,got it,”)

Elif guess_age > age_of_oldboy:

       Print(“think smaller…”)

Else:

       Print (“think bigger!”)

 

 

 

用户名判断

_username = ’alex’               用户

_password = ’abc123’             密码

Username =input (“username:”) 

Password =input (“password:”)

If _username == username and _password == password:

       Print(“welcome user {name} login…”.format(name=username)) 成功 

Else:

       Print(“invalid username or password!”)    不成功

if,else判断