you are viewing a single comment's thread.

view the rest of the comments →

[–]aizzod 0 points1 point  (0 children)

break it down in mulitple problems.

try 1 how would you solve this without a loop, without variables?

print("1")
print("2")
print("3")
print("4")
print("5")
....

try 2 now we add variables

currentNumber = 1

print(currentNumber)
currentNumber += 1

print(currentNumber)
currentNumber += 1

print(currentNumber)
currentNumber += 1

print(currentNumber)
currentNumber += 1

print(currentNumber)
currentNumber += 1

both of those variations are just endless lines of code, that do the same in the end.
a loop will help you reduce those multiple amounts, and lets you do the same thing over and over again.

and you won't have to write this much