Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Mostly A's - Shane
- #Mostly B's - Rick
- #Mostly C's - Daryl
- #Mostly D's - The Governor
- import itertools
- import operator
- def most_common(L):
- SL = sorted((x, i) for i, x in enumerate(L))
- groups = itertools.groupby(SL, key=operator.itemgetter(0))
- def _auxfun(g):
- item, iterable = g
- count = 0
- min_index = len(L)
- for _, where in iterable:
- count += 1
- min_index = min(min_index, where)
- return count, -min_index
- return max(groups, key=_auxfun)[0]
- table=[]
- print("Which 'Walking Dead' character are you?")
- print()
- print("A man has a member of your group at gunpoint, what do you do?")
- print()
- print(" [A] = Fire at him, ey, what's the worst that could happen?")
- print(" [B] = Attempt to reason with the man show that he is in control and has a choice")
- print(" [C] = Attempt to make a distraction and get a quick clean shot to his head")
- print(" [D] = Shoot the man, then the group member. What use are they to you when they're mentally scared")
- choice1=input()
- table.append(choice1)
- print("You spot a stranger on the street and manage to flank him, he has got a lot of gear you could use. What do you do?")
- print()
- print(" [A] = Walk straight up behind him with a shotgun to his head and tell him to drop everything of value")
- print(" [B] = Leave the area, there could be more of them nearby")
- print(" [C] = Signal for the man, lower your weapon and ask him some questions")
- print(" [D] = Shoot the man in the leg, walk up to him and take his stuff then leave him for the walkers")
- choice2=input()
- table.append(choice2)
- print(table)
- final=(most_common(table))
- if final == ("A"):
- print("You are Rick")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement