Advertisement
Guest User

Untitled

a guest
Jan 13th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.61 KB | None | 0 0
  1. def details():
  2. create = False
  3. myfile = open("day.txt", "a+")
  4. myfile.write(str("username" + "password"))
  5. myfile.write("/n")
  6. while create == False:
  7. name = (raw_input("Enter Your Name"))
  8. age = (raw_input("Enter Your Age"))
  9. yr_group=int(input("Enter Your Year Group"))
  10. username = (name[0:3])+str(age)
  11. password = raw_input("Enter a Password")
  12. u_p =username+","+password
  13. myfile.write(str(u_p))
  14. myfile.write("/n")
  15. create = True
  16. myfile.close()
  17.  
  18. def topics():
  19. print("Type History")
  20. print("Type Music")
  21. print("Type Computerscience")
  22. choice=str(input("Enter what choice you want"))
  23. if choice in["History" , "history"]:
  24. history()
  25. if choice in["Music" , "music"]:
  26. music()
  27. if choice in["Computerscience" , "computerscience"]:
  28. computerscience()
  29.  
  30. def History():
  31. print("Type Easy for Easy Mode")
  32. print("Type Medium for Medium Mode")
  33. print("Type Hard for Hard Mode")
  34. choice1=str(input("Enter a Choice"))
  35. score =0
  36. if choice1 in ["Easy" , "easy"]:
  37. Q1 = False
  38. Q2 = False
  39. Q3 = False
  40. Q4 = False
  41. Q5 = False
  42. while Q1 == False:
  43. print("Question 1: When did WW1 begin?")
  44. print("Type1 for 1914")
  45. print("Type2 for 1925")
  46. A1 = ("Input a Year")
  47. if A1 in["1","2"]:
  48. Q1 = True
  49. else:
  50. print ("Try Again")
  51. while Q2 == False:
  52. print("Question 2: When did WW2 begin?")
  53. print("Type1 for 1934")
  54. print("Type2 for 1939")
  55. A2 = ("Input a Number")
  56. if A2 in["1","2"]:
  57. Q2 = True
  58. else:
  59. print ("Try Again")
  60. while Q3 == False:
  61. print("Question 3: In what country was Adolf HItler born in?")
  62. print("Type1 for Austria")
  63. print("Type2 for Germany")
  64. A3 = ("Input a Number")
  65. if A3 in["1","2"]:
  66. Q3 = True
  67. else:
  68. print ("Try Again")
  69. while Q4 == False:
  70. print("Question 4: What Year was the Battle of Hastings?")
  71. print("Type1 for 1066")
  72. print("Type2 for 1096")
  73. A4 = ("Input a Number")
  74. if A4 in["1","2"]:
  75. Q4 = True
  76. else:
  77. print ("Try Again")
  78. while Q5 == False:
  79. print("Question 5: What type of flower is worn on Remeberance Day in Britain?")
  80. print("Type1 for Poppies")
  81. print("Type2 for Tulips")
  82. A5 = ("Input a Number")
  83. if A5 in["1","2"]:
  84. Q5 = True
  85. else:
  86. print ("Try Again")
  87. else:
  88. if A1 =="1":
  89. score = score+1
  90. if A2 =="2":
  91. score = score+1
  92. if A3 =="2":
  93. score = score+1
  94. if A4 =="1":
  95. score = score+1
  96. if A5 =="1":
  97. score = score+1
  98. print("You got" ,score,"/5")
  99. print("Your Percentage is",score/5*100,"X")
  100.  
  101. elif choice1 in ["Medium" , "medium"]:
  102. Q1 = False
  103. Q2 = False
  104. Q3 = False
  105. Q4 = False
  106. Q5 = False
  107. while Q1 == False:
  108. print("Question 1: When did WW1 begin?")
  109. print("Type1 for 1920")
  110. print("Type2 for 1934")
  111. print("Type3 for 1914")
  112. A1 = ("Input a Number")
  113. if A1 in["1","2","3"]:
  114. Q1 = True
  115. else:
  116. print ("Try Again")
  117. while Q2 == False:
  118. print("Question 2: When did WW2 begin?")
  119. print("Type1 for 1920")
  120. print("Type2 for 1923")
  121. print("Type3 for 1939")
  122. A2 = ("Input a Number")
  123. if A2 in["1","2","3"]:
  124. Q2 = True
  125. else:
  126. print ("Try Again")
  127. while Q3 == False:
  128. print("Question 3: In what country was Adolf HItler born in?")
  129. print("Type1 for Austria")
  130. print("Type2 for Germany")
  131. print("Type3 for France")
  132. A3 = ("Input a Number")
  133. if A3 in["1","2","3"]:
  134. Q3 = True
  135. else:
  136. print ("Try Again")
  137. while Q4 == False:
  138. print("Question 4: What Year was the Battle of Hastings?")
  139. print("Type1 for 1070")
  140. print("Type2 for 1066")
  141. print("Type2 for 1096")
  142. A4 = ("Input a Number")
  143. if A4 in["1","2","3"]:
  144. Q4 = True
  145. else:
  146. print ("Try Again")
  147. while Q5 == False:
  148. print("Question 5: What type of flower is worn on Remeberance Day in Britain?")
  149. print("Type1 for Tulips")
  150. print("Type2 for Poppies")
  151. print("Type3 for Daisys ")
  152. A5 = ("Input a Number")
  153. if A5 in["1","2","3"]:
  154. Q5 = True
  155. else:
  156. print ("Try Again")
  157. else:
  158. if A1 =="3":
  159. score = score+1
  160. if A2 =="3":
  161. score = score+1
  162. if A3 =="1":
  163. score = score+1
  164. if A4 =="2":
  165. score = score+1
  166. if A5 =="2":
  167. score = score+1
  168. print("You got" ,score,"/5")
  169. print("Your Percentage is",score/5*100,"X")
  170.  
  171. elif choice1 in ["Hard" , "hard"]:
  172. Q1 = False
  173. Q2 = False
  174. Q3 = False
  175. Q4 = False
  176. Q5 = False
  177. while Q1 == False:
  178. print("Question 1: When did WW1 begin?")
  179. print("Type1 for 1920")
  180. print("Type2 for 1934")
  181. print("Type3 for 1940")
  182. print("Type3 for 1914")
  183. A1 = ("Input a Number")
  184. if A1 in["1","2","3","4"]:
  185. Q1 = True
  186. else:
  187. print ("Try Again")
  188. while Q2 == False:
  189. print("Question 2: When did WW2 begin?")
  190. print("Type1 for 1920")
  191. print("Type2 for 1923")
  192. print("Type3 for 1939")
  193. print("Type3 for 1929")
  194. A2 = ("Input a Number")
  195. if A2 in["1","2","3","4"]:
  196. Q2 = True
  197. else:
  198. print ("Try Again")
  199. while Q3 == False:
  200. print("Question 3: In what country was Adolf HItler born in?")
  201. print("Type1 for England")
  202. print("Type2 for Austria")
  203. print("Type3 for Germany")
  204. print("Type4 for France")
  205. A3 = ("Input a Number")
  206. if A3 in["1","2","3","4"]:
  207. Q3 = True
  208. else:
  209. print ("Try Again")
  210. while Q4 == False:
  211. print("Question 4: What Year was the Battle of Hastings?")
  212. print("Type1 for 1066")
  213. print("Type2 for 1084")
  214. print("Type2 for 1096")
  215. print("Type3 for 1070")
  216. A4 = ("Input a Number")
  217. if A4 in["1","2","3","4"]:
  218. Q4 = True
  219. else:
  220. print ("Try Again")
  221. while Q5 == False:
  222. print("Question 5: What type of flower is worn on Remeberance Day in Britain?")
  223. print("Type1 for Tulips")
  224. print("Type2 for Poppies")
  225. print("Type3 for Lopels ")
  226. print("Type3 for Daisys")
  227. A5 = ("Input a Number")
  228. if A5 in["1","2","3",4]:
  229. Q5 = True
  230. else:
  231. print ("Try Again")
  232. else:
  233. if A1 =="4":
  234. score = score+1
  235. if A2 =="3":
  236. score = score+1
  237. if A3 =="2":
  238. score = score+1
  239. if A4 =="1":
  240. score = score+1
  241. if A5 =="2":
  242. score = score+1
  243. print("You got" ,score,"/5")
  244. print("Your Percentage is",score/5*100,"X")
  245. else:
  246. print("Invalid Choice")
  247.  
  248. def Music():
  249. print("Type Easy for Easy Mode")
  250. print("Type Medium for Medium Mode")
  251. print("Type Hard for Hard Mode")
  252. choice1=str(input("Enter a Choice"))
  253. score =0
  254. if choice1 in ["Easy" , "easy"]:
  255. Q1 = False
  256. Q2 = False
  257. Q3 = False
  258. Q4 = False
  259. Q5 = False
  260. while Q1 == False:
  261. print("Question 1: What is pitch?")
  262. print("Type1 for How high or low something is")
  263. print("Type2 for How loud or soft something is")
  264. A1 = ("Input a Number")
  265. if A1 in["1","2"]:
  266. Q1 = True
  267. else:
  268. print ("Try Again")
  269. while Q2 == False:
  270. print("Question 2: What is crescedo?")
  271. print("Type1 for Gradually getting quiter")
  272. print("Type2 for Gradually getting softer")
  273. A2 = ("Input a Number")
  274. if A2 in["1","2"]:
  275. Q2 = True
  276. else:
  277. print ("Try Again")
  278. while Q3 == False:
  279. print("Question 3: What is Fortissimo?")
  280. print("Type1 for Very Quiet")
  281. print("Type2 for Very Low")
  282. A3 = ("Input a Number")
  283. if A3 in["1","2"]:
  284. Q3 = True
  285. else:
  286. print ("Try Again")
  287. while Q4 == False:
  288. print("Question 4: What is tempo?")
  289. print("Type1 for how fast or slow something is")
  290. print("Type2 for the quality of a tone")
  291. A4 = ("Input a Number")
  292. if A4 in["1","2"]:
  293. Q4 = True
  294. else:
  295. print ("Try Again")
  296. while Q5 == False:
  297. print("Question 5: What is Rhythm?")
  298. print("Type1 for the study pulse of number")
  299. print("Type2 for 3 or more notes played at the same time")
  300. A5 = ("Input a Number")
  301. if A5 in["1","2"]:
  302. Q5 = True
  303. else:
  304. print ("Try Again")
  305. else:
  306. if A1 =="1":
  307. score = score+1
  308. if A2 =="2":
  309. score = score+1
  310. if A3 =="2":
  311. score = score+1
  312. if A4 =="1":
  313. score = score+1
  314. if A5 =="1":
  315. score = score+1
  316. print("You got" ,score,"/5")
  317. print("Your Percentage is",score/5*100,"X")
  318.  
  319. elif choice1 in ["Medium" , "medium"]:
  320. Q1 = False
  321. Q2 = False
  322. Q3 = False
  323. Q4 = False
  324. Q5 = False
  325. while Q1 == False:
  326. print("Question 1: When did WW1 begin?")
  327. print("Type1 for 1920")
  328. print("Type2 for 1934")
  329. print("Type3 for 1914")
  330. A1 = ("Input a Number")
  331. if A1 in["1","2","3"]:
  332. Q1 = True
  333. else:
  334. print ("Try Again")
  335. while Q2 == False:
  336. print("Question 2: When did WW2 begin?")
  337. print("Type1 for 1920")
  338. print("Type2 for 1923")
  339. print("Type3 for 1939")
  340. A2 = ("Input a Number")
  341. if A2 in["1","2","3"]:
  342. Q2 = True
  343. else:
  344. print ("Try Again")
  345. while Q3 == False:
  346. print("Question 3: In what country was Adolf HItler born in?")
  347. print("Type1 for Austria")
  348. print("Type2 for Germany")
  349. print("Type3 for France")
  350. A3 = ("Input a Number")
  351. if A3 in["1","2","3"]:
  352. Q3 = True
  353. else:
  354. print ("Try Again")
  355. while Q4 == False:
  356. print("Question 4: What Year was the Battle of Hastings?")
  357. print("Type1 for 1070")
  358. print("Type2 for 1066")
  359. print("Type2 for 1096")
  360. A4 = ("Input a Number")
  361. if A4 in["1","2","3"]:
  362. Q4 = True
  363. else:
  364. print ("Try Again")
  365. while Q5 == False:
  366. print("Question 5: What type of flower is worn on Remeberance Day in Britain?")
  367. print("Type1 for Tulips")
  368. print("Type2 for Poppies")
  369. print("Type3 for Daisys ")
  370. A5 = ("Input a Number")
  371. if A5 in["1","2","3"]:
  372. Q5 = True
  373. else:
  374. print ("Try Again")
  375. else:
  376. if A1 =="3":
  377. score = score+1
  378. if A2 =="3":
  379. score = score+1
  380. if A3 =="1":
  381. score = score+1
  382. if A4 =="2":
  383. score = score+1
  384. if A5 =="2":
  385. score = score+1
  386. print("You got" ,score,"/5")
  387. print("Your Percentage is",score/5*100,"X")
  388.  
  389. elif choice1 in ["Hard" , "hard"]:
  390. Q1 = False
  391. Q2 = False
  392. Q3 = False
  393. Q4 = False
  394. Q5 = False
  395. while Q1 == False:
  396. print("Question 1: When did WW1 begin?")
  397. print("Type1 for 1920")
  398. print("Type2 for 1934")
  399. print("Type3 for 1940")
  400. print("Type3 for 1914")
  401. A1 = ("Input a Year")
  402. if A1 in["1","2","3","4"]:
  403. Q1 = True
  404. else:
  405. print ("Try Again")
  406. while Q2 == False:
  407. print("Question 2: When did WW2 begin?")
  408. print("Type1 for 1920")
  409. print("Type2 for 1923")
  410. print("Type3 for 1939")
  411. print("Type3 for 1929")
  412. A2 = ("Input a Number")
  413. if A2 in["1","2","3","4"]:
  414. Q2 = True
  415. else:
  416. print ("Try Again")
  417. while Q3 == False:
  418. print("Question 3: In what country was Adolf HItler born in?")
  419. print("Type1 for England")
  420. print("Type2 for Austria")
  421. print("Type3 for Germany")
  422. print("Type4 for France")
  423. A3 = ("Input a Number")
  424. if A3 in["1","2","3","4"]:
  425. Q3 = True
  426. else:
  427. print ("Try Again")
  428. while Q4 == False:
  429. print("Question 4: What Year was the Battle of Hastings?")
  430. print("Type1 for 1066")
  431. print("Type2 for 1084")
  432. print("Type2 for 1096")
  433. print("Type3 for 1070")
  434. A4 = ("Input a Number")
  435. if A4 in["1","2","3","4"]:
  436. Q4 = True
  437. else:
  438. print ("Try Again")
  439. while Q5 == False:
  440. print("Question 5: What type of flower is worn on Remeberance Day in Britain?")
  441. print("Type1 for Tulips")
  442. print("Type2 for Poppies")
  443. print("Type3 for Lopels ")
  444. print("Type3 for Daisys")
  445. A5 = ("Input a Number")
  446. if A5 in["1","2","3","4"]:
  447. Q5 = True
  448. else:
  449. print ("Try Again")
  450. else:
  451. if A1 =="4":
  452. score = score+1
  453. if A2 =="3":
  454. score = score+1
  455. if A3 =="2":
  456. score = score+1
  457. if A4 =="1":
  458. score = score+1
  459. if A5 =="2":
  460. score = score+1
  461. print("You got" ,score,"/5")
  462. print("Your Percentage is",score/5*100,"X")
  463. else:
  464. print("Invalid Choice")
  465.  
  466. menu = False
  467. while menu == False:
  468. print("***********************")
  469. print("Welcome to My Quiz")
  470. print("You must register first")
  471. details(),
  472. topics()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement