Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def game_questions():
- guessed = []
- CORRECT_GUESSES = 0
- question_num = 1
- for key in questions:
- print("|---------------------|")
- print(key)
- for i in options[question_num-1]:
- print(i)
- guess = input("Answer must be between A-C!\n:").upper()
- guessed.append(guess)
- question_num += 1
- CORRECT_GUESSES += game_check_answer(questions.get(key),guess)
- game_point_display(CORRECT_GUESSES)
- def game_check_answer(answer,guess):
- if answer == guess:
- print(f"\nCorrect!\nYour guess was {guess}, and the answer is {answer}")
- return 1
- else:
- print("worng!:(\n")
- return 0
- def game_point_display(CORRECT_GUESSES):
- print("Results are:\n")
- safe = int((CORRECT_GUESSES/len(questions))*100)
- print(f"Calculation: {safe}%")
- pass
- def game_run():
- score = 0
- name = input(" What is your name! \n:")
- print(" Hello, " + name + "! Nice to meet you!")
- print(" To give the correct answer, press the letter corresponding to the answer and then press enter")
- game_questions()
- def game_start():
- gamest = input(" Press x to continue! \n:")
- #Start of the program
- if gamest != 'x':
- gamest = input("If you wan't to quit press anything but ' x '\n:")
- if gamest != 'x':
- print("Closed")
- quit()
- else:
- game_run()
- else:
- game_run()
- questions = {
- "Which is the largest country by population?": "A",
- "Approximately, how many billions of people are on Earth?":"C",
- "What is the symbol of the unit of measurement of electrical voltage?": "B",
- "What is the measuring instrument for measuring electric current intensity?": "B",
- "This one is for gamers! When was Minecraft released?": "A",
- "Which is the biggest ocean?": "C",
- "What is the altitude of Everest Peak?": "C",
- "Where does the abbreviation RAM came from?": "B",
- "Who painted the starry night?":"B",
- "Which is the largest country by the aera?": "A"
- }
- options = [["A. China","B. Russia", "C. Canada"],
- ["A. 7","B. 10","C. 8"],
- ["A. I", "B. V", "C. F"],
- ["A. Voltmeter","B. Ammeter", "C. Ohmmeter"],
- ["A. 18 November 2011","B. 18 December 2011","C. 20 June 2010"],
- ["A. The Atlantic Ocean,","B. The Indian Ocean", "C. The Pacific Ocean"],
- ["A. 90000m","B. 8878m","C. 8848m"],
- ["A. Read-Acces memory","B. Random-Acces memory","C. Read-Only memory"],
- ["A. Leonardo Da Vinci","B. Vincent Van Gogh", "C. Tizilao Vecellio"],
- ["A. Russia","B. Brazil","C. China"]]
- game_start()
Advertisement
Add Comment
Please, Sign In to add comment