for loop python start at 1
# starts at 1 up to, but not including, 5
for i in range(1, 5)
print(i)
for loop python start at 1
# starts at 1 up to, but not including, 5
for i in range(1, 5)
print(i)
python loop back to start
def main(): #defines the area in indents that will be triggered with main()#
print('hi')
yn = input('Wanna loop back to the start? ')
if yn = 'yes':
main() #loops back to where we defined main#
main() #This starts the main loop, without this, main would just be defined but not run#
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.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us