keyboard_arrow_left keyboard_arrow_right
Atharva's Project

## Atharva's Trivia Quiz

Atharva Aditya Balvalli, Grade 7 student from Bahrain has created a short 5 questions quiz. After answering all the questions, you will be rated between Outstanding to Needs Improvement.

#### Atharva's project details:

Welcome to Atharva's Trivia Quiz
Atharva has intelligently used many concepts of Python programming to create this quiz. Read the rules of the quiz and also have a look at his code. Check out the cool coloring effect is given when the answer is right and wrong

Every correct answer will give you 100 points but every wrong answer will deduct 10 points

Let’s start the quiz!

```class bcolors:
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
OKRED    = '\033[91m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
print("\n Welcome to Atharva's Trivia Quiz")

print("Every correct answer will give get 100 points but every wrong answer will deduct 10 points ")

print("\n 1) Who is the Prime Minister of India?\na.Narendra Modi \nb.George Washington \nc.Dr.Rajendra Prasad \nd. Magal Pandey")
ans = (input("Enter your option by typing a,b,c,d: "))

score = 0

if ans=="a" or ans=="A":
score = score+100
else:
score = score-10

print("\n 2) When was the first Cricket World Cup held?\na.1975 \nb.1983 \nc.1979 \nd.1971")
ans = (input("Enter your option by typing a,b,c,d: "))
if ans=="a" or ans=="A":
score += 100
else:
score -= 10

print("\n 3) What is a small tree with a slender stem?\na.seed \nb.Mango Tree \nc.Sapling \nd.Neem ")
ans = (input("Enter your option by typing a,b,c,d: "))
if ans=="c" or ans=="C":
score += 100
else:
score -= 10

print("\n 4) Who is the best chess player in the world?\na.Vishwanathan Anand \nb.Magnus Carlsen \nc.Fabiano Caruana \nd.Nihal Sarin")
ans = (input("Enter your option by typing a,b,c,d: "))
if ans=="b" or ans=="B":
score += 100
else:
score -= 10

print("\n 5) Which of these is a series of Anime?\na.Pirates Of The Caribbean \nb.Dirlis:Ertugrul \nc.Peaky Builders \nd.Hunter x Hunter")
ans = (input("Enter your option by typing a,b,c,d: "))
if ans=="d" or ans=="D":
score += 100
else:
score -= 10

if score == 500:
#print("Outstanding")
#print(bcolors.OKGREEN+"Outstanding"+bcolors.ENDC)
elif score == 390:
#print("Very Good")
#print(bcolors.OKGREEN+"Very Good"+bcolors.ENDC)
elif score >= 260 and score< 390:
#print("Good")
#print(bcolors.OKBLUE+"Good"+bcolors.ENDC)
elif score <= 170:
#print("Need Improvement")
#print(bcolors.OKRED+"Need Improvement"+bcolors.ENDC)
print("\n"+ bcolors.UNDERLINE +"Your final rating is:"+bcolors.ENDC)

print('|------------------------------------------|')
print('|                                          |')
print('|                                          |')
print('|'+'            '+ finalgrade + '                   |' )
print('|                                          |')
print('|                                          |')
print('|------------------------------------------|')
print("\n Thank you for attempting this quiz")

```