One of many paths · in code: Switch / Case
Picks one path out of many, by comparing a value with each case in turn. If none match, it takes Otherwise.
1, words in quotes like "tea".Open it in the editor, press Run, then change it and run it again.
colourcolourWhen it is "red" →
"Stop!"When it is "yellow" →
"Get ready..."When it is "green" →
"Go!"Otherwise →
"That is not a traffic light colour."greenIt showsGo!blueIt showsThat is not a traffic light colour.colour = input("Pick a colour: red, yellow or green ")if colour == "red": print("Stop!")elif colour == "yellow": print("Get ready...")elif colour == "green": print("Go!")else: print("That is not a traffic light colour.")