Looping in Python

Week 6 - Python

Created: 2022-07-23
Tags: #fleeting


alternative for while loop that

  • uses length as a condition to end
  • this is good for an list that changes its length during runtime
for i in range(len(arr)):
    pass

range() function

`range(start, stop, [step])

Try these:
My prediction is the loop will end until the end of the character or basically the length of the character

variable = "Hello there"
for i in range(variable):

References