code that will count the number ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

code that will count the number ?

#like this but only one while count = 0 while count < 11 : print(count) count = count + 1 else: count = 10 while count > 0 : print(count) count = count - 1

16th Nov 2017, 5:28 AM
zura bakuradze
zura bakuradze - avatar
5 Answers
+ 7
You no need for else: count = 0 while count < 11 : print(count) count = count + 1 count = 10 while count > 0 : print(count) count = count - 1
16th Nov 2017, 5:32 AM
Vukan
Vukan - avatar
+ 6
Not really know what you mean here...
15th Nov 2017, 9:18 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar
+ 4
don't understand your point?
16th Nov 2017, 4:42 AM
᠌᠌Brains[Abidemi]
᠌᠌Brains[Abidemi] - avatar
+ 3
If you mean a code to reverse the number, here is one: def print_reversed(n): if n > 0: print((n % 10), end='') print_reversed(int(n / 10)) print_reversed(543210)
16th Nov 2017, 12:30 AM
Boris Batinkov
Boris Batinkov - avatar
+ 1
#i wrote it but not so good count = 0 while count < 11 : print(count) count = count + 1 else: count = 10 while count > 0 : print(count) count = count - 1
16th Nov 2017, 5:19 AM
zura bakuradze
zura bakuradze - avatar