#1.使用while循环输入123456 8 9 10 count=0 while count < 10: count = count + 1 if count == 7: continue print(count)
#2.求1-100所有数的和 a = 0 sum = 0 while a < 100: a += 1 sum += a print(sum)
#3.输出1-100所有奇数 a = 1 while a<100: a=a+1 if a %2 != 0: print(a)
#4.输出1-100所有偶数 count = 1 while count < 100: count = count + 1 if count %2 == 0: print(count)
#Q5.求1-2+3-4+5...99所有数的和 first = 0 sum = 0 while first < 99: first = first + 1 if first %2 == 0: sum = sum - first else: sum = sum + first print(sum)
#Q6.用户登陆三次机会重试 count = 0 while count < 3: username = input('enter your name') password = input('enter your password') if username == ('nero') and password == ('kate'): print('success') break else: print('error') count = count + 1