Advertisement
Guest User

code

a guest
Jan 14th, 2020
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. import time, os
  2.  
  3. points = 0
  4. time.sleep(3)
  5. print('Computer Trivia Game')
  6. print('Version 1.0.3')
  7. if os.path.exists("data.ini"):
  8. time.sleep(5)
  9. print('TROPHY: You beat the game')
  10. time.sleep(5)
  11. print('NOTE: Due to problems, if you fail a question you need to restart the program. This will be fixed in later versions.')
  12. time.sleep(3)
  13. print('Loading trivia...')
  14. time.sleep(10)
  15. print('Question 1:')
  16. print('What part of the computer stores information but is read only?')
  17. print('a) Hard Disk')
  18. print('b) RAM')
  19. print('c) Motherboard')
  20. print('d) ROM')
  21. print('Type the letter that is assigned to the answer.')
  22. q1 = input()
  23. if q1 == 'd':
  24. points = 1
  25. print('Correct!')
  26. print('You currently have',points,'points')
  27. time.sleep(3)
  28. print('Question 2:')
  29. print('What is the slowest media out of these:')
  30. print('a) SSD')
  31. print('b) RAM')
  32. print('c) CD-ROM')
  33. print('d) USB')
  34. print('Type the letter that is assigned to the answer.')
  35. q2 = input()
  36. if q2 == 'c':
  37. points = 2
  38. print('Correct!')
  39. print('You currently have',points,'points')
  40. time.sleep(3)
  41. print('Question 3:')
  42. print('A computer cannot work without')
  43. print('a) USB')
  44. print('b) CPU')
  45. print('c) DVD Drive')
  46. print('d) Microsoft Word')
  47. print('Type the letter that is assigned to the answer.')
  48. q3 = input()
  49. if q3 == 'b':
  50. points = 3
  51. print('Correct!')
  52. print('You currently have',points,'points')
  53. time.sleep(3)
  54. print('Question 4:')
  55. print('How do we measure the speed of a CPU?')
  56. print('a) MB')
  57. print('b) GHZ')
  58. print('c) HZ')
  59. print('d) TB')
  60. print('Type the letter that is assigned to the answer.')
  61. q4 = input()
  62. if q4 == 'b':
  63. points = 4
  64. print('Correct!')
  65. print('You currently have',points,'points')
  66. time.sleep(3)
  67. print('Question 5:')
  68. print('What does SSD mean?')
  69. print('a) Super Speed Drive')
  70. print('b) Speedy Sport Disk')
  71. print('c) Solid State Drive')
  72. print('d) Solid Speed Drive')
  73. print('Type the letter that is assigned to the answer.')
  74. q5 = input()
  75. if q5 == 'c':
  76. points = 5
  77. print('Correct!')
  78. print('You currently have',points,'points')
  79. time.sleep(3)
  80. print('Question 6:')
  81. print('What connection do most hard drives use today?')
  82. print('a) SATA')
  83. print('b) Micro-USB')
  84. print('c) HDMI')
  85. print('d) Ethernet')
  86. print('Type the letter that is assigned to the answer.')
  87. q6 = input()
  88. if q6 == 'a':
  89. points = 6
  90. print('Correct!')
  91. print('You beat the game for now!')
  92. print('You finished the game with',points,'points')
  93. if points = 6:
  94. with open("data.ini", "a") as file:
  95. file.write("finished_game = 1")
  96. print('Expect more updates soon!')
  97. input('Press any key to exit')
  98.  
  99. else:
  100. print('Incorrect answer!')
  101. print('You failed the game with',points,'points')
  102. input('Press any key to exit')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement