0% found this document useful (0 votes)
6 views4 pages

Fun Quiz on Pop Singers, Countries, Animals

The document is a Python script for a quiz game that tests users on topics like pop singers, countries, and animals. It includes functions to ask questions of varying difficulty levels and updates the user's score based on correct or incorrect answers. The game allows users to select topics and progressively narrows down available options as they answer questions.

Uploaded by

tran024824
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

Fun Quiz on Pop Singers, Countries, Animals

The document is a Python script for a quiz game that tests users on topics like pop singers, countries, and animals. It includes functions to ask questions of varying difficulty levels and updates the user's score based on correct or incorrect answers. The game allows users to select topics and progressively narrows down available options as they answer questions.

Uploaded by

tran024824
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import time

POPSINGER_EASY = "Who wrote the song Boombayah?" #answer Blackpink


POPSINGER_NORMAL = "What's Alex Benjamin's most streamed song on Spotify of
2024?"#answer Let me down slowly
POPSINGER_HARD = "When is Felix Stray Kids birthday?"#answer 15/9/2000

COUNTRY_EASY = "What is the biggest country in the world?" #answer Russia


COUNTRY_NORMAL = "Which country invented the compass?" #answer China
COUNTRY_HARD = "In which country is the city of love?" #answer France

ANIMALS_EASY = "What is the biggest mammal on Earth?" #answer The blue whale
ANIMALS_NORMAL = "Which animal holds the record for the fastest diving animal?"
#answer The Peregrine falcon
ANIMALS_HARD = "How many hearts does an octopus have? " #answer three

score = 0
available_topics = "Pop singers, Countries, Animals"
prompt = "Choose 1 for Pop singers, 2 for Countries, 3 for Animals"

def ask_Popsingers_questions():
global score
print(POPSINGER_EASY)
answer = int(input("Enter your answer here: "))
if answer == "Blackpink":
print("You are correct.")
print("Your current score is", score)
score = score + 2
print("Your score is increased by 2. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 7
print("Your score is decreased by 7. The updated score is:", score)
print()
print(POPSINGER_NORMAL)
answer = int(input("Enter your answer here: "))
if answer == "Let me down slowly" :
print("You are correct.")
print("Your current score is", score)
score = score + 5
print("Your score is increased by 5. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 12
print("Your score is decreased by 12. The updated score is:", score)
print()
print(POPSINGER_HARD)
answer = int(input("Enter your answer here: "))
if answer == "15/9/2000":
print("You are correct.")
print("Your current score is", score)
score = score + 7
print("Your score is increased by 7. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 20
print("Your score is decreased by 20. The updated score is:", score)
def ask_sci_questions():
global score
print(COUNTRY_EASY)
answer = int(input("Enter your answer here: "))
if answer == "Russia":
print("You are correct.")
print("Your current score is", score)
score = score + 2
print("Your score is increased by 2. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 7
print("Your score is decreased by 7. The updated score is:", score)
print()
print(COUNTRY_NORMAL)
answer = int(input("Enter your answer here: "))
if answer == "China":
print("You are correct.")
print("Your current score is", score)
score = score + 5
print("Your score is increased by 5. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 12
print("Your score is decreased by 12. The updated score is:", score)
print()
print(COUNTRY_HARD)
answer = input("Enter your answer here: ")
if answer == "France":
print("You are correct.")
print("Your current score is", score)
score = score + 7
print("Your score is increased by 7. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 20
print("Your score is decreased by 20. The updated score is:", score)

def ask_eng_questions():
global score
print(ANIMALS_EASY)
answer = input("Enter your answer here: ")
if answer == "The blue whale":
print("You are correct.")
print("Your current score is", score)
score = score + 5
print("Your score is increased by 5. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 7
print("Your score is decreased by 7. The updated score is:", score)
print()
print(ANIMALS_NORMAL)
answer = input("Enter your answer here: ")
if answer == "The Peregrine falcon":
print("You are correct.")
print("Your current score is", score)
score = score + 10
print("Your score is increased by 10. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 12
print("Your score is decreased by 12. The updated score is:", score)
print()
print(ANIMALS_HARD)
answer = input("Enter your answer here: ")
if answer == "three":
print("You are correct.")
print("Your current score is", score)
score = score + 15
print("Your score is increased by 15. The updated score is:", score)
else:
print("You are wrong.")
print("Your current score is", score)
score = score - 20
print("Your score is decreased by 20. The updated score is:", score)

def advance_game(selection):
global available_topics
global prompt

if available_topics == "Pop singers, Countries, Animals":


if selection == 1:
available_topics = "Science, English"
prompt = "Choose 2 for Countries, 3 for Animals"
elif selection == 2:
available_topics = "Pop singers, Animals"
prompt = "Choose 1 for Pop singers, 3 for Animals"
elif selection == 3:
available_topics = "Pop singers, Countries"
prompt = "Choose 1 for Pop singers, 2 for Countries"

elif available_topics == "Countries, Animals":


if selection == 1:
print("Pop singers is already chosen, choose between Countries and
Animals instead")
return False
elif selection == 2:
available_topics = "Animals"
prompt = "Choose 3 for Animals"
elif selection == 3:
available_topics = "Countries"
prompt = "Choose 2 for Countries"

elif available_topics == "Pop singers, Animals":


if selection == 1:
available_topics = "Animals"
prompt = "Choose 3 for Animals"
elif selection == 2:
print("Countries is already chosen, choose between Pop singers and
Animals instead")
return False
elif selection == 3:
available_topics = "Pop singers"
prompt = "Choose 1 for Pop singers"

elif available_topics == "Pop singers, Countries":


if selection == 1:
available_topics = "Countries"
prompt = "Choose 2 for Countries "
elif selection == 2:
available_topics = "Pop singers"
prompt = "Choose 1 for Pop singers "
elif selection == 3:
print("Animals is already chosen, choose between Pop singers and
Countries instead")
return False

elif available_topics == "Pop singers":


if selection == 1:
available_topics = ""
else:
print("The only available topic is Pop singers, please choose
accordingly")
return False

elif available_topics == "Countries":


if selection == 2:
available_topics = ""
else:
print("The only available topic is Countries, please choose
accordingly")
return False
elif available_topics == "Animals":
if selection == 3:
available_topics = ""
else:
print("The only available topic is Animals, please choose accordingly")
return False

return True
if selection == 1:
ask_Popsingers_questions()
elif selection ==2:
ask_Countries_questions()
elif selection == 3:
ask_Animals_questions()
else:
print("You choose an invalid input, choose among the available ones")
print()

if available_topics == "":
print("Congrats, you have finished the game. Your final score is")
print(score)
print("Game exited")

You might also like