1 #-*- coding: UTF-8 -*- 2 #print('中国') 3 ''' 4 s = 20 5 y = 15 6 print(s*y) 7 print(s**2) 8 print(s%y) 9 print(s/y) 10 print(s>y) 11 print(s4 : 19 print(1212) 20 else: 21 print(12) 22 ''' 23 ''' 24 num = input('猜数字:') 25 26 if num == '1' : 27 print('一二三') 28 elif num == '2' : 29 print('四五六') 30 else: 31 print('七八九') 32 33 a = 1 34 while a <= 100 : 35 print(a) 36 a = a + 1 37 38 a = 1 39 b = 0 40 while a <= 1000 : 41 b = a + b 42 a = a + 1 43 print(b) 44 a = 1 45 b = True 46 while b : 47 print(a) 48 a = a + 1 49 if a > 100 : 50 break 51 a = 0 52 while a < 10 : 53 a = a + 1 54 if a == 7 : 55 print(' ') 56 else: 57 print(a) 58 ''' 59 #1-2+3.....99 60 # count = 1 61 # while count < 101 : 62 # print(count) 63 # count += 2 64 # count = 1 65 # while count < 101 : 66 # if count % 2 == 0 : 67 # print(count) 68 # # count += 1 69 # sum = 0 70 # count = 1 71 # while count < 100 : 72 # if count % 2 == 0 : 73 # sum = sum - count 74 # else: 75 # sum = sum + count 76 # count = count + 1 77 # print(sum) 78 ''' 79 #设置三次登录 80 count = 0 81 while count < 3 : 82 username = input('请输入账号: ') 83 password = int (input('请输入密码: ')) 84 if username == 'abc' and password == 123 : 85 print('登录成功') 86 break 87 else: 88 print('登录失败') 89 count += 1 90 ''' 91 """ 92 # #格式化输出:# % s d 93 # name = input('请输入你的姓名:') 94 # age = input('请输入你的年龄:') 95 # sg = input('请输入你的身高:') 96 # hobbie = input('你的爱好:') 97 # msg = '''----- info of %s----- 98 # Name : %s 99 # Age : %s100 # Sg : %s101 # Hobbie :%s102 # ----- END-----''' %(name,name,int(age),sg,hobbie)103 # print(msg)104 """