python if else 流程判断

1.if-else 语句:

uesrname="sy"

age=18

-username=input("username:")

-age=input("age:")

if -username=username and -age=age:

   print("welcome in {name}".format(name=username))

else:

  print("please check out the username")

ps:if-else语句中if,else同级,顶格写,print属于其子程序会自动缩进,因此很容易看出这一模块的起始。,if和else都有冒号。

2.多条判断语句

if ....

elif....

else...

猜你喜欢

转载自www.cnblogs.com/sy615/p/10910238.html