python基础之分支结构

python基础之分支结构 if ... else ....

#if ... else 循环
username = input('请输入用户名\n').strip()
password  = input('请输入密码\n').strip()

if username == 'admin' and password='123456':
    print('登陆成功')
else:
    print('用户名或者密码错误,请重新登陆')

 

# if ... el: ... else:

score = int(input('您的考试分数\n').strip())
if score>90:
    print('A+')
el score>80:
    print('A')
el score>70:
    print('B+')
el score>60:
    print('B')
else:
   print('C')

 

posted @ 2018-10-02 13:37  巫小诗  阅读(278)  评论(0编辑  收藏  举报