Loop in Python
Loop in Python
List in Python 2
Loop
Loop
• I want to write my
name 10 times so
what ways I can
achieve this.
E.g.(continue)
•It checks the condition first — if it's true, it runs the code inside.
•When you don't know how many times you need to repeat.
•You want to keep doing something until a certain thing happens.
while condition:
# Code to repeat
•i=1
• while i <= 5:
• print(i)
• i += 1