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!')
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!')