PythonHackingBook1 icon indicating copy to clipboard operation
PythonHackingBook1 copied to clipboard

1.4 流程控制

Open request101 opened this issue 5 years ago • 0 comments

Username=str(input('请输入用户名:'))
password=int(input('请输入密码:'))
if(Username=='seven'):
    if(password==123):
        print("登陆成功!")
    else:
        print("登陆失败!")

i=2
sum=0
while(i<=100):
    if(i%2==0):
        sum+=i
    else:
        sum-=i
    i+=1
print(sum)

request101 avatar Jun 03 '19 09:06 request101