0
I don't know how to add the 'print("Finished!")' line
On the page with i = 1 while i <=5: print(i) i = i + 1 print("Finished!") I don't know how to type out the print("Finished") line because when I press enter the code just runs instead of adding a not indented line. I'm using python 3.8 (32-bit) so maybe its related to that, but I have no idea.
5 ответов
+ 1
I don't really understand what you mean but this works in sololearn
i = 1
while i <=5:
print(i)
i = i + 1
print("Finished!")
+ 1
Your code seems all right . But what is the problem can you make your question more clear
+ 1
KK Yu You are probably writing your commands in a terminal interpreter instead of an IDE:
https://www.sololearn.com/discuss/1035940/?ref=app
+ 1
Try this:
i = 1
while i <= 5:
print(i)
i += 1
else:
print("Finished!")
0
im not using the coding thing that the website provides im using python 3.8 and i cant type the print("finished") part of the code because pressing enter twice in a row while typing the indentation (which is reqiured to write that line of the code)
i cant type because enter makes the code run on python 3.8 if im not indented