+ 1

while loop

how to make, input: 10 output : 10 + 8 + 6 + 4 + 2 + 0 = 30 using while. please help😊😊. thanks

14th Oct 2016, 12:10 PM
Angel
Angel - avatar
2 odpowiedzi
+ 2
i = int(input()) sum = 0 while i > 0: sum += i i -= 2 print(str(sum))
14th Oct 2016, 12:22 PM
Zen
Zen - avatar
0
its output is an even number of inputs countdown until 0 thanks before
14th Oct 2016, 12:33 PM
Angel
Angel - avatar