Advertisement
Enrro

Trivia 110633

Nov 6th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. '''
  2. Created on 05/11/2014
  3. Trivia con 10 preguntas y 3 respuestas para cada pregunta
  4. Proven and tested on python 3.3.3
  5. @author: A01221672
  6. '''
  7. def answearsAtRandom(qu2):
  8. re2 = []
  9. for r in range(1,20,2):
  10. re2.append(r)
  11. piv0 = qu2+1
  12. re2.remove(piv0)
  13. piv1 = random.choice(re2)
  14. re2.remove(piv1)
  15. piv2 = random.choice(re2)
  16. re2.remove(piv2)
  17. pivA = [piv0,piv1,piv2]
  18. Art1 =random.sample(pivA,3)
  19. for co1 in range(len(Art1)):
  20. print(foo[Art1[co1]])
  21. return piv0
  22. import random
  23.  
  24.  
  25. foo = ["How many pairs of ribs would the normal human have?","12","Who wrote the classic novel Les Miserables??","Victor Hugo","What was the name of Sherlock Holmes Housekeeper?","Mrs Hudson","Which actress played the part of Sybil Fawlty in Television?s Fawlty Towers?","Prunella Scale","What was the title of Beethoven?s only opera?","Fidelio","Which river flows through the city of Dublin?","Liffey","Who appeared with David McCallum in the title role of the TV series ?Sapphire and Steel??","Joanna Lumley","Which Irishman won the Tour de France in 1987?","Stephen Roche","In which European country is Cro-Magnon, famous for the discovery of four Palaeolithic skeletons in 1868?","France","Which town is the administrative centre for the Open University? ","Milton Keynes"]
  26. qu1 = []
  27. h0 = []
  28. re1 = []
  29. h3 = 0
  30.  
  31. for j in range(0,20,2):
  32. qu1.append(j)
  33.  
  34. for x in range(0,20,2):
  35. h0.append(x)
  36.  
  37. for q in range(1,20,2):
  38. re1.append(q)
  39.  
  40.  
  41. for question in qu1:
  42. h1 = random.choice((h0))
  43. print(foo[h1])
  44. answearsAtRandom(h1)
  45. h0.remove(h1)
  46. h2 = input()
  47. if h2 == foo[h1+1]:
  48. h3 = h3 + 10
  49. print("")
  50.  
  51. print("Your total score is " + str(h3) + " points")
  52. if h3 > 90:
  53. print ("You are the best")
  54. elif h3 >50:
  55. print("You did a good job")
  56. else:
  57. print("Congratulations")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement