Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Indicates a random item is selected
- from random import choice
- print ( " I am the teacher and I'm asking you questions about the colors.")
- #A questions list is created.
- questions =["What color is the sky?", "What color is the ocean?", "What color are blueberries?"]
- #A random question is selected from the above list.
- question = choice(questions)
- #The answer the student states is put into lower case lettering so there are no case sensitivity issues.
- answer = input(question).lower()
- #While the student doesn't answer blue the teacher continues to ask what color the object is.
- while answer != "blue":
- answer = input("Tell me again what color it is: ").strip().lower()
- #When the student types blue in any case the teacher rewards the student.
- print ("You got it right! Here's a sticker")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement