for loop explained python code example
Example 1: python for loop
for x in (list):
print(x)
Example 2: loops in python
#While Loop:
while ("condition that if true the loop continues"):
#Do whatever you want here
else: #If the while loop reaches the end do the things inside here
#Do whatever you want here
#For Loop:
for x in range("how many times you want to run"):
#Do whatever you want here
Example 3: python for loop
A for loop iterates through an iterable, may that be an array, a string, or a range of numbers
#Example:
myArr = ["string 1", "string 2"]
for x in myArr:
print(x)
#Returns "string 1", "string 2". In here the x is an iterator and does not need to be defined.