python入门:if和else的基本用法

 1 #!/usr/bin/env python
 2 # -*- coding:utf-8 -*-
 3 #2.X用raw_input,3.X用input
 4 #if和else的基本用法
 5 name = input("Username:")
 6 pwd = input("Password:")
 7 if name == "alex" and pwd =="123":
 8     print ('yes!')
 9 else:
10     print('no!')    

 

posted @ 2017-11-23 18:27  俊豪郎  阅读(3675)  评论(0编辑  收藏  举报