8y5 python loops
TRANSCRIPT
Loopy Loops
LEARNING OBJECTIVE
Understand how to create a loop in Python and use a
Boolean variable to define when to stop.
ANOTHER VARIABLE
Boolean – This can store one of two values:▪ True▪ False
LOOPSA While loop can keep looping through events until a condition changes.
WHILE hungry == TrueKeep eatingIF I’m full up
hungry == False
Have a go at this ‘Guess the Number’ game. What
does each part do?
LEARNING OBJECTIVE
Understand how to create a loop in Python and use a
Boolean variable to define when to stop.
or