0

a=int(input('Enter the number:')) i=0 while i<=a: print(i) i=i+1 print("Finished!")

Why am i getting error in this?

28th Jul 2019, 8:56 AM
Dhyey Badheka
Dhyey Badheka - avatar
2 odpowiedzi
+ 6
Aaron, you are absolutely right - issue is indentation. should look like this: a=int(input('Enter the number:')) i=0 while i<=a: print(i) i=i+1 print("Finished!")
28th Jul 2019, 9:21 AM
Lothar
Lothar - avatar
+ 2
I guess this is Python so it might be because you indented the code inside the loop incorrectly
28th Jul 2019, 9:02 AM
Aaron Eberhardt
Aaron Eberhardt - avatar