-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpersonality quiz.py
121 lines (106 loc) · 3.46 KB
/
personality quiz.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
print("Hello, Contosoville!")
# ash the candidate a question
activity = input("How do you spend your evening?\n(A Reading a book\n(B) Attending a party\n")
# print out which activity they chose
print(f"You chose {activity}.")
# if they chose reading a book
if activity == "A":
print("Nice choice!")
elif activity == "B":
print("Sounds fun!")
else:
print("You must type A or B, let's just say you like to read.")
activity = "A"
# ask the candidate a second question
job = input("What is your dream job?\n(A) Curator at the Smithstonian\n(B) Running a business\n")
if job == "A":
print("Curator, nice choice!")
elif job == "B":
print("Running a business? Sounds fun!")
else:
print("You must type A or B, let's just say you want to be a curator at the Smithstonian")
job = "A"
# Ask the candidate a third question
value = input( "What's more important?\n(A) Money\n(B) Love\n" )
if value == "A":
print( "Money, nice choice!" )
elif value =="B":
print( "Love? Sounds fun!" )
else:
print("You must type A or B, let's just say money is more important to you.")
value = "A"
# ask the candidate a fourth question
decade = input( "What's your favorite decade?\n(A) 1910s\n(B) 2010s\n" )
if decade == "A":
print( "1910s, nice choice!" )
elif decade =="B":
print( "2010s? Sounds fun!" )
else:
print("You must type A or B, let's just say the 1910s is your favorite decade.")
decade = "A"
# ask the candidate a fifth question
travel = input( "What's your favorite way to travel?\n(A) Driving\n(B) Flying\n" )
if travel == "A":
print( "Driving, nice choice!" )
elif travel =="B":
print( "Flying? Sounds fun!" )
else:
print("You must type A or B, let's just say your favorite way to travel is by driving")
travel = "A"
# print out their choices
print( f"You chose {activity}, then {job}, then {value}, then {decade}, then {travel}.")
# create some variables for scoring
sam_like = 0
cam_like = 0
kai_like = 0
indy_like = 0
# update scoring variables based on the activity choice
if activity == "A":
sam_like = sam_like + 2
indy_like = indy_like + 2
kai_like = kai_like + 2
else:
cam_like = cam_like + 1
indy_like = indy_like + 1
# update scoring variables based on the job choice
if job == "A":
sam_like = sam_like + 2
indy_like = indy_like + 2
cam_like = cam_like - 1
else:
sam_like = sam_like - 1
kai_like = kai_like + 2
indy_like = indy_like + 1
# update scoring variables based on the value choice
if value == "A":
sam_like = sam_like - 1
kai_like = kai_like + 1
else:
sam_like = sam_like + 2
cam_like = cam_like + 2
indy_like = indy_like + 1
# update scoring variables based on the decade choice
if decade == "A":
cam_like = cam_like + 2
sam_like = sam_like + 2
else:
kai_like = kai_like + 1
indy_like = indy_like + 2
# update scoring variables based on the travel choice
if travel == "A":
sam_like = sam_like - 2
kai_like = kai_like + 1
indy_like = indy_like - 1
else:
sam_like = sam_like + 1
cam_like = cam_like + 1
kai_like = kai_like - 1
# print the results depending on the score
if sam_like >= 3:
print( "You're most like Sharp-Eyed Sam!" )
elif cam_like >= 3:
print( "You're most like Curious Cam!" )
elif kai_like >= 3:
print( "You're most like Keen Kai!" )
else:
print( "You're most like Inquisitive Indy!" )