Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- name = input("What is your name? \n")
- age = input("How old are you? \n")
- sex = input("What is your gender? \n")
- general_culture_questions = 'General Questions'
- animals_questions = 'Animals Questions'
- capitals_questions = 'Capitals Questions'
- math_questions = 'Math Questions'
- geography_questions = 'Geography Questions'
- logical_questions = 'Logical Questions'
- score=0
- questions = [general_culture_questions, animals_questions, capitals_questions, math_questions, geography_questions, logical_questions]
- print(f"Hello {name}. Good Luck!")
- print ("Are you ready to begin?")
- input ("Press Enter when you are ready to begin...")
- print("Welcome to the General Culture Questions Quiz 1")
- time.sleep(3)
- print ("Note: You must answer using A, B, C or D")
- time.sleep(3)
- print (" ")
- class Question:
- def __init__(self, prompt, answer):
- self.prompt = prompt
- self.answer = answer
- question_prompts = [
- "Q1: How many days are there in a normal year?\n(a) 365\n(b) 366\n(c) 362\n(d) 368\n\n",
- "Q2: Which month of the year has the least number of days?\n(a) June\n(b) February\n(c) July\n(d) May\n\n",
- "Q3: How many weeks are there in one year?\n(a) 51\n(b) 54\n(c) 53\n(d) 52\n\n",
- "Q4: Which is the nearest star to planet earth?\n(a) Sun\n(b) Moon\n(c) Mars\n(d) Jupiter\n\n",
- "Q5: Which day is observed as World Environment Day?\n(a) 5 July\n(b) 2 August\n(c) 5 June\n(d) 12 September\n\n",
- "Q6: Who invented the Computer?\n(a) Mark Zuckerberg\n(b) Bill Gates\n(c) Steve Jobs\n(d) Charles Babbage\n\n",
- "Q7: How many teeth does a healthy adult have including the wisdom teeth?\n(a) 32\n(b) 34\n(c) 30\n(d) 33\n\n",
- "Q8: How many strings does a violin have?\n(a) 6\n(b) 8\n(c) 4\n(d) 12\n\n",
- "Q9: How many planets are there in our solar system?\n(a) 8\n(b) 6\n(c) 10\n(d) 9\n\n",
- "Q10: How many days are there in the month of February in a leap year?\n(a) 28\n(b) 29\n(c) 30\n(d) 27\n\n",
- ]
- questions = [
- Question(question_prompts[0], "a"),
- Question(question_prompts[1], "b"),
- Question(question_prompts[2], "a"),
- Question(question_prompts[3], "d"),
- Question(question_prompts[4], "c"),
- Question(question_prompts[5], "d"),
- Question(question_prompts[6], "a"),
- Question(question_prompts[7], "c"),
- Question(question_prompts[8], "a"),
- Question(question_prompts[9], "a"),
- ]
- def run_quiz(questions):
- score = 0
- for question in questions:
- answer = input(question.prompt)
- if answer == question.answer:
- score += 1
- print("you got", score, "out of", len(questions))
- run_quiz(questions)
- score=int()
- print("Are you ready for the next step quiz?")
- input ("Press any key to continue...")
- print("Welcome to the General Culture Questions Quiz 2 - Capital Questions")
- print("Question 1")
- input ("Press any key to continue...")
- Question1 = input ("What is the capital of Italy? \n")
- if Question1 == ("Rome") or Question1 == ("rome"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Rome")
- time.sleep(1)
- print("Question 2")
- time.sleep(1)
- Question2 = input ("What is the capital of France? \n")
- if Question2 == ("Paris") or Question2 == ("paris"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Paris")
- print("Question 3")
- time.sleep(3)
- Question2 = input ("What is the capital of Germany? \n")
- if Question2 == ("Berlin") or Question2 == ("berlin"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Berlin")
- print("Question 4")
- time.sleep(1)
- Question2 = input ("What is the capital of Romania? \n")
- if Question2 == ("Bucharest") or Question2 == ("bucharest"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Bucharest")
- print("Question 5")
- time.sleep(1)
- Question2 = input ("What is the capital of China? \n")
- if Question2 == ("Beijing") or Question2 == ("beijing"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Beijing \n")
- print("Question 6")
- time.sleep(1)
- Question2 = input ("What is the capital of Afghanistan? \n")
- if Question2 == ("Kabul") or Question2 == ("kabul"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Kabul \n")
- print("Question 7")
- time.sleep(1)
- Question2 = input ("What is the capital of Brazil? \n")
- if Question2 == ("Brasilia") or Question2 == ("brasilia"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Brasilia")
- print("Question 8")
- time.sleep(1)
- Question2 = input ("What is the capital of England? \n")
- if Question2 == ("London") or Question2 == ("london"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is London")
- print("Question 9")
- time.sleep(1)
- Question2 = input ("What is the capital of Iraq? \n")
- if Question2 == ("Baghdad") or Question2 == ("baghdad"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is Baghdad")
- print("Question 10")
- time.sleep(1)
- Question2 = input ("What is the capital of Monaco? \n")
- if Question2 == ("Monaco") or Question2 == ("monaco"):
- print("Correct answer")
- score += 1
- else:
- print("Incorrect answer, the correct answer is London")
- print("You got",(score),"/ 10")
- num1 = (score)
- num2 = 10
- print('{0:.2f}%'.format((num1 / num2 * 100)))
- print("Are you ready for the next step quiz?")
- input ("Press any key to continue...")
- print("Welcome to the General Culture Questions Quiz 3 - Logical Questions")
- print("Question 1")
- input ("Press any key to continue...")
- def tf_quiz(question, correct_ans):
- if input("(T/F) " + question + ": ") == correct_ans:
- return("correct")
- else:
- return("incorrect")
- print ("Note: T is for True and F is for False")
- print ("You must answer by T or F")
- time.sleep(3)
- quiz_eval = tf_quiz("Despite their brain size, elephant memory is short-lived.", "F")
- quiz_eval = tf_quiz("Penguins can't be found on the continent of Africa.", "F")
- quiz_eval = tf_quiz("Horses can sleep standing up.", "T")
- quiz_eval = tf_quiz("The Amazon River has native dolphins.", "T")
- quiz_eval = tf_quiz("Camels store water in their humps.", "F")
- quiz_eval = tf_quiz("Female reindeer have antlers.", "T")
- quiz_eval = tf_quiz("Birds can fly.", "T")
- quiz_eval = tf_quiz("You can’t teach an old dog new tricks.", "F")
- quiz_eval = tf_quiz("Zebrafish can suffer from insomnia?", "T")
- quiz_eval = tf_quiz("Bats are not blind.", "T")
- print("You got",(score),"/ 10")
- num1 = (score)
- num2 = 10
- print('{0:.2f}%'.format((num1 / num2 * 100)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement