I am new to phyton
All of us have been new once, it is not sin. Just take one step at time and test your code.
for the quiz i want
questions
answers
number of questions to ask
score
number of questioned asked so far
can you help me out? im confused
Good luck! We can help anybody who shows proper effort and posts spesific question after proving effort.
well so far i got this
print ("Welcome to my quiz!")
begin = (input("would you like to begin?: "))
if begin =="yes":
q1 = (input("Is Steve Jobs is the founder of Apple?"))
if q1 == "true" or q1 == "True":
print ("well done! you got it right!")
if q1 == "False" or q1 == "false":
print ("wrong, try again")
else :
print ("Thanks for trying my quiz! Goodbye")
This is how I would fix it (I used beginning lines to get it run also in Python2)
# make input equal to Python3 style input even in Python2
try:
input = raw_input
except:
pass
print("Welcome to my quiz!")
questions = (("Is Steve Jobs the founder of Apple?", 'yes'),
("Is this stupid program?", 'no'))
for q, right in questions:
if input(q).lower() == right:
print("Well done! You got it right!")
else:
print("You got it wrong this time!")
Edited 4 Years Ago
by pyTony
how do i add number of questions to ask
i want to make sure that people can ask how many question the want to answer in my quiz. how can i do that?
# make input equal to Python3 style input even in Python2
try:
input = raw_input
except:
pass
def questions ():
global questionlist
print =("how many question do you want to answer")
while questioncount < 4:
print("Welcome to my yes or no quiz!")
questions = (('))
for q, right in questions:
if input(q).lower() == right:
print("Well done! You got it right!")
else:
print("You got it wrong this time!") ...