python之路-day1-if...else...流程判断

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python之路-day1-if...else...流程判断相关的知识,希望对你有一定的参考价值。

判断输入的用户名:
#
Author:zww _username = "zww" _password = "123" username = input("username:") password = input("password:") if username == _username and password == _password: print("Welcome {user} login" .format(user=username)) else: print("Invalid username or password!")
#Author:zww
age_of_jay = 40
guess_age = int(input("guess_age:"))
if guess_age > age_of_jay:
    print("think smaller..." )
elif guess_age < age_of_jay:
    print("think bigger...")
else:
    print("yes,you got it!")

 


以上是关于python之路-day1-if...else...流程判断的主要内容,如果未能解决你的问题,请参考以下文章

Python之路目录

python学习之路

Python之路目录

Python学习之路 目录

Python之路——进入Python学习

Python之路