0% found this document useful (0 votes)
15 views6 pages

CS Sub 3

The document describes a Python program that creates an animal quiz game. It contains sections on introduction, objective, source code, output and result. The quiz asks 3 animal related questions and scores points for correct answers. At the end the total score is displayed.

Uploaded by

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

CS Sub 3

The document describes a Python program that creates an animal quiz game. It contains sections on introduction, objective, source code, output and result. The quiz asks 3 animal related questions and scores points for correct answers. At the end the total score is displayed.

Uploaded by

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

CS PROJECT

ANIMAL QUIZ

Done by:
Akshay kannaa
Class : 12-B1
Contents
s.no
Description
1.
INTRODUCTION
2.
OBJECTIVE
3.
SOURCE CODE
4.
OUTPUT
5.
RESULT
6.
BIBLIOGRAPHY
PROJECT ON ANIMAL QUIZ

INTRODUCTION
This article, I’ll walk you through how to create a quiz game with Python. I will create an
animal quiz here
. This quiz game uses a function; a block of code with a name that performs a specific
task. A function allows you to use the same code several times, without having to type
everything each time. Python has a lot of built-in functions, but it also allows you to
create your functions.
OBJECTIVE
The Quiz game asks the player questions about animals. They have three chances to
answer each question you don’t want to take the quiz too difficult. Each correct answer
will score a point. At the end of the game, the program will reveal the player’s final score.

SOURCE CODE

check_guess(guess, answer):
global score still_guessing = True
attempt = 0 while still_guessing and
attempt < 3: if guess.lower() ==
answer.lower():
print("Correct Answer")
score = score + 1
still_guessing = False
else: if attempt < 2:
guess = input("Sorry Wrong Answer, try again")
attempt = attempt + 1 if attempt == 3:
print("The Correct answer is ",answer )

score = 0 print("Guess
the Animal")
guess1 = input("Which bear lives at the North Pole? ")
check_guess(guess1, "polar bear") guess2 =
input("Which is the fastest land animal? ")
check_guess(guess2, "Cheetah") guess3 =
input("Which is the larget animal? ")
check_guess(guess3, "Blue Whale") print("Your Score
is "+ str(score))
OUTPUT

Which bear lives at the North Pole? polar bear


Correct Answer
Which is the fastest land animal? cheetah
Correct Answer
Which is the larget animal? blue whale
Correct Answer
Your Score is 3

RESULT
Thus the python program has been executed successfully and the output is verified.
BIBLIOGRAPHY

• Computer science with python – class IX & XII___by PREETI ARORA

• http://python.mykvs.in/projects.php

You might also like