#-*-coding:utf-8-*-# a. 使用while循環實現輸出2-3+4-5+6...+100 的和# count = 0# count2 = 2# while count2 < 101:# if count2 % 2 == 0:# count += count2# else:# count -= count2# count2 += 1# print(count)# b. 使用 while 循環實現輸出 1,2,3,4,5, 7,8,9, 11,12# count = 0# while count < 13:# count += 1# if count == 6 or count == 10:# pass# else:# print(count)# c. 使用while 循環輸出100-50,從大到小,如100,99,98...,到50時再從0循環輸出到50,而後結束# count = 100# num = 0# while True:# if count < 50:# print(num)# num += 1# if num > 50:# break# else:# print(count)# count -= 1# d. 使用 while 循環實現輸出 1-100 內的全部奇數# count = 1# while count < 101:# if count % 2 == 1:# print(count)# count += 1# e. 使用 while 循環實現輸出 1-100 內的全部偶數# count = 1# while count < 101:# if count % 2 == 0:# print(count)# count += 1