Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

animal quiz game in python

animal_list = ['Fish' , 'Tarantula' , 'Snake' , 'an Octopus']
animal=random.choice(animal_list)
print("Choice an animal:Fish,Tarantula,Snake and Octopus")
if     
Comment

animal quiz game in python


class Question:
    def __init__(self, text, answer):
        self.text = text
        self.answer = answer

question_bank = []
question_data = [
{"text": "A slug's blood is green.", "answer": "True"},
{"text": "The loudest animal is the African Elephant.", "answer": "False"},
{"text": "Approximately one quarter of human bones are in the feet.", "answer": "True"},
{"text": "The total surface area of a human lungs is the size of a football pitch.", "answer": "True"},
{"text": "In West Virginia, USA, if you accidentally hit an animal with your car, "
         "you are free to take it home to eat.", "answer": "True"},
{"text": "In London, UK, if you happen to die in the House of Parliament, "
         "you are entitled to a state funeral.", "answer": "False"},
{"text": "It is illegal to pee in the Ocean in Portugal.", "answer": "True"},
{"text": "You can lead a cow down stairs but not up stairs.", "answer": "False"},
{"text": "Google was originally called 'Backrub'.", "answer": "True"},
{"text": "Buzz Aldrin's mother's maiden name was 'Moon'.", "answer": "True"},
{"text": "No piece of square dry paper can be folded in half more than 7 times.", "answer": "False"},
{"text": "A few ounces of chocolate can to kill a small dog.", "answer": "True"}
]

for item in question_data:
    question_bank.append(Question(item["text"], item["answer"]))

print(question_bank)

Comment

PREVIOUS NEXT
Code Example
Python :: check two list python not match 
Python :: machine earning to predict sentimentanalysis python 
Python :: machine learning project outline 
Python :: in np array how to make element as 1 if it exceeds the threshold 
Python :: pydrive set parents 
Python :: forward fill pandas ffill 
Python :: pygame kreis definition 
Python :: command run test keep db python 
Python :: python initialize a 2d array 
Python :: pandas map 
Python :: matlab index last element 
Python :: jhon wick 
Python :: Python program to remove newline characters from a file 
Python :: como inserir regras usg pelo prompt 
Python :: how to check if an array is empty in python 
Python :: Catching Specific Exceptions in Python 
Python :: Python Create a Local Variable 
Python :: Modifying a set in Python 
Python :: pd drop a range of dates 
Python :: With Python, it is possible to use the ** operator to calculate powers 
Python :: how to save text file content to variable python 
Python :: rom requests_html import HTML 
Python :: python secret module to generate secure strings 
Python :: how to rub softwares using python 
Python :: access dictionary in f string 
Python :: how to produce txt file from list python 
Python :: how to choose appropriate graph for dataset visualization 
Python :: subsetting a column and giving it a value using numpy 
Python :: Move x-ticks to the middle of each bin 
Python :: filter parent based on related child name values 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =