+ 1
Iteration
Im always confuse this
3 Antworten
+ 3
Describe the problem more precisely. Ask a question.
Do not mark your own comment as "best" when it is not an answer to the question.
+ 3
Surush ,
Iteration (and verb, iterate) is a general computer-language term meaning (roughly) doing the same thing to many things in a row, one by one.
That's usually accomplished with "loop" structures. In Python, the available loops are for and while.
For example, if I wanted to print every character of a string, one by one, I might use a for loop to iterate through the characters of the string, printing each one as I find it.
my_string = "farm"
for character in my_string:
print(character)
Output:
f
a
r
m
+ 1
Ok