Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- phrase = input("talk to me>")
- if phrase == "hi" or phrase == "hey" or phrase == "yo" or phrase == "sup?":
- print("hello")
- elif phrase == "whats your name?" or phrase == "what's your name?" or phrase == "who are you?":
- print("My name is Rotellity, the maths bot")
- else:
- print("sorry I dont understand" + " " + phrase + " I am a maths bot after all!")
- username = input("What's your name?")
- print("hello " + username)
- phrase = input("do you want to play a game?")
- if phrase == "yes" or phrase == "yeah" or phrase == "hell yeah!":
- print("brilliant! let's get started!")
- elif phrase == "no" or phrase == "no way!" or phrase == "nah":
- print("aw come on now, it will be fun! let's give it a go!")
- else:
- print("I am a simple maths bot and cannot understand " + phrase + " so I will accept that as a yes! Let's get started!")
- phrase = input("how many eggs are in a carton of a dozen eggs?")
- if phrase == "twelve" or phrase == "12":
- print("yes indeed, " + username + " you are correct!")
- else:
- print("I'm sorry, " + username + " the answer I was looking for is 12!")
- phrase = input("now for a more tricky question: how many minutes are there in a 24 hour perdiod? We will make this one multiple choice! Is it 1,200 minutes, 1,440 minutes or 1,620 minutes?")
- if phrase == "1,440" or phrase == "1440" or phrase == "1,440 minutes" or phrase == "1440 minutes":
- print("absolutely correct! You got it " + username + " !")
- else:
- print("Good effort " + username + " ! " + "Unfortunately the correct answer is 1,440 minutes.")
- phrase = input("ok let's do one last question: how many hours are there in a typical year, ie not a leap year? Are there 8,760 hours, 12,624 hours or 14,848 hours?")
- if phrase == "8760" or phrase == "8760 hours" or phrase == "8,760" or phrase == "8,760 hours":
- print("ding ding ding, we have a winner! Good job " + username + " !")
- else:
- print("No, I'm sorry " + username + " the correct answer is 8,760 hours.")
- print ("thank you for participating in my quiz. goodbye!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement