Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- vehicleQ = '''
- The 1st category is vehicles. What is: 1 vehicle you would like:
- Another vehicle you would like:
- A final vehicle you would like:
- What is a vehicle that you would hate to have (e.g: a trolley!)?:
- Another vehicle you'd hate to have:
- The final vehicle you wouldn't want: '''
- jobsQ = '''
- Now it's jobs! What is: 1 job you'd like:
- 2nd job you'd like:
- 3rd job you'd like:
- A job you'd absolutely hate to have:
- 2nd job you'd hate:
- 3rd job you'd hate:'''
- spouseQ = '''
- Now it's husbands/wives! Who is: 1 spouse you'd like:
- ...another:
- and a final one:
- And a spouse you'd absolutely hate to have:
- 2nd spouse you'd hate:
- 3rd spouse you'd hate:'''
- kidsQ = '''
- Now it's kids! What is: a number of kid's you'd like to have:
- 2nd number:
- Final number you'd like:
- A number of kids you'd absolutely hate to have:
- 2nd number you'd hate:
- 3rd number you'd hate:'''
- # ....
- # more questions sets formatted like above
- # ...
- def processQuestions(questionSet):
- answers = []
- for question in questionSet.split('\n')[1:]:
- answer = raw_input(question)
- answers.append(answer)
- return answers
- def printResults(randomAns):
- print
- print '''You will drive/ride a/an: {0}
- You will be a: {1}
- You'll be married to: {2}
- You will have: {3} kids
- '''.format(*randomAns)
- questionSets = [vehicleQ,jobsQ,spouseQ,kidsQ]
- randomAnswers = []
- for qSet in questionSets:
- qSetAnswers = processQuestions(qSet)
- randomAns = random.choice(qSetAnswers)
- randomAnswers.append(randomAns)
- printResults(randomAnswers)
Advertisement
Add Comment
Please, Sign In to add comment