+ 12
When I add for loop error occur, Could you explain me what mistake?
"""Example": x = 17 17 * 3 + 1 = 52 """ s = int(input("Enter number: ")) print(s) for i in range(5): a=s*3+1 print(a)
4 odpowiedzi
+ 5
use this if you want to print a one time
s = int(input("Enter number: "))
print(s)
a=s*3+1
print(a)
use this if 5 time
s = int(input("Enter number: "))
print(s)
for i in range(5):
a=s*3+1
print(a)
hope it helped.
edited. thanks James Clark I. Vinarao. it was a mistake
+ 7
You have to make an indent (a set of spaces) of the code in the loop. Refer to the lesson below on indentation:
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2277/
+ 6
I got it . I need to add space 5 times where I went to loop the code. Thank you so much all my friends for sharing your thoughts.
+ 4
Indentation error spotted in a=s*3+1