Advertisement
Guest User

Untitled

a guest
Dec 21st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. #Mostly A's - Shane
  2. #Mostly B's - Rick
  3. #Mostly C's - Daryl
  4. #Mostly D's - The Governor
  5.  
  6. import itertools
  7. import operator
  8.  
  9. def most_common(L):
  10. SL = sorted((x, i) for i, x in enumerate(L))
  11. groups = itertools.groupby(SL, key=operator.itemgetter(0))
  12. def _auxfun(g):
  13. item, iterable = g
  14. count = 0
  15. min_index = len(L)
  16. for _, where in iterable:
  17. count += 1
  18. min_index = min(min_index, where)
  19. return count, -min_index
  20. return max(groups, key=_auxfun)[0]
  21.  
  22. table=[]
  23.  
  24. print("Which 'Walking Dead' character are you?")
  25. print()
  26. print("A man has a member of your group at gunpoint, what do you do?")
  27. print()
  28. print(" [A] = Fire at him, ey, what's the worst that could happen?")
  29. print(" [B] = Attempt to reason with the man show that he is in control and has a choice")
  30. print(" [C] = Attempt to make a distraction and get a quick clean shot to his head")
  31. print(" [D] = Shoot the man, then the group member. What use are they to you when they're mentally scared")
  32. choice1=input()
  33. table.append(choice1)
  34.  
  35. 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?")
  36. print()
  37. print(" [A] = Walk straight up behind him with a shotgun to his head and tell him to drop everything of value")
  38. print(" [B] = Leave the area, there could be more of them nearby")
  39. print(" [C] = Signal for the man, lower your weapon and ask him some questions")
  40. print(" [D] = Shoot the man in the leg, walk up to him and take his stuff then leave him for the walkers")
  41. choice2=input()
  42. table.append(choice2)
  43. print(table)
  44.  
  45. final=(most_common(table))
  46.  
  47. if final == ("A"):
  48. print("You are Rick")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement