python22 sequence of "non-decreasing" numbers def main(): print("Enter a sequence of non-decreasing numbers.") count = 0 last_num = float(input('Enter num: ')) cur_num = last_num while cur_num >= last_num: count += 1 #this line can go anywhere in body(while) last_num = cur_num cur_num = float(input('Enter num: ')) print("Thanks for playing") print("sequence length: " + str(count)) (Suggested 15 minutes) Write a program that asks the user to.. 2020. 6. 12. print odd numbers (1 ~199) 3가지 방법 def main(): for i in range (100): print (i*2 +1) for i in range(200): if i % 2 == 1: print (i) v=1 while v 2020. 6. 12. 이전 1 2 다음