Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def quiz():
- score = 0
- answer1 = input('What type of tree do dates grow on? \na - Palm trees; \nb - Fir trees; \nc - Hand trees? \n: ')
- if answer1 == 'a':
- print('CORRECT!')
- score = score + 1
- else:
- print('INCORRECT')
- answer2 = input('What is the name of the highest Mountain in Africa? \na - Mount Kenya; \nb - Mount Kilimanjaro; \nc - Mount Wanahakalugi? \n: ')
- if answer2 == 'b':
- print('CORRECT!')
- score = score + 1
- else:
- print('INCORRECT')
- total = int(score)
- print('That is the end of the quiz. You scored ', total,'/2')
- phrase = input('Talk to me >')
- if phrase == 'hi' or phrase == 'hey':
- print('Hello')
- elif phrase == 'What is your name?' or phrase == 'What\'s your name?':
- print ('Marvin')
- elif phrase == 'How old are you?' or phrase == 'Are you old?':
- print ('A robot never tells his age!')
- else:
- print('Sorry I do not understand \'' + phrase + '\'')
- phrase2 = input('How are you doing? : ')
- if phrase2 == 'good' or phrase2 == 'great':
- print('I am glad to hear that you are ' + phrase2)
- else:
- print('Sorry that you are just ' + phrase2)
- phrase3 = input('Would you like to do a short quiz - yes or no? : ')
- if phrase3 == 'yes':
- print('GREAT!')
- quiz()
- else:
- print('Ok')
- print('Bye')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement