python day1

Posted 121211abc

tags:

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

if slse

_username = "alex"
_password = "abc123"
username = input("username:")
password = input("password:")
if _username == username and _password == password:
    print("welcom user{name} login...".format(name = username))
else:
    print("invalid username or password!")

while

age_of_oldboy = 56

count = 0
while True:
    if count == 3:
        break
    guess_age = int(input("guess age:"))
    if guess_age == age_of_oldboy:
        print("you got it:")
        break;
    elif guess_age > age_of_oldboy:
        print("think smaller!")
    else:
        print("think bigger!")
    count +=1

 

以上是关于python day1的主要内容,如果未能解决你的问题,请参考以下文章

坚持Selenium+Python学习之从读懂代码开始 DAY1

Python学习-day1

Python之路,day1

小白的Python之路 day1 字符编码

DAY1-初识python

python学习day1