Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hello, welcome to my quiz!")
- name=input("Please enter your name to begin: ")
- print("Welcome, " +name+ ", let's begin.")
- print("This quiz contains 15 questions relating to python coding, each question will have one correct answer and there will be four options for each question.")
- print("The answers will be accepted as capital letters ONLY. The accepted input will be like this: 'A'")
- print ('\n-----------------------------------------------------------\n')
- # making the score and seting the score to zero
- score=0
- score=int(score)
- # time for the questions!
- print("Question one: How do you get text to display in the output box correctly? (There will be ' instead of quotation marks)")
- print("A. print(Like this)")
- print("B. input('Like this')")
- print("C. print('Like this')")
- print("D. input(Like this)")
- Q1answer="C"
- Q1response=input("Your answer: ")
- if(Q1response!=Q1answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q1response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question two: What does \ r do?")
- print("A. It moves text to the right.")
- print("B. It moves text forward like the tab key.")
- print("C. It moves text down.")
- print("D. It moves text to the left.")
- Q2answer="D"
- Q2response=input("Your answer: ")
- if(Q2response!=Q2answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q2response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question three: What does a # with text in front of it do?")
- print("A. It adds a comment")
- print("B. It adds plain text with no formatting")
- print("C. It makes the text italicized")
- print("D. It bolds the text")
- Q3answer="A"
- Q3response=input("Your answer: ")
- if(Q3response!=Q3answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q3response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question four: Which of the following is an assignment operator?")
- print("A. @")
- print("B. $")
- print("C. =")
- print("D. &")
- Q4answer="C"
- Q4response=input("Your answer: ")
- if(Q4response!=Q4answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q4response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question five: How do you import a calendar?")
- print("A. load calendar")
- print("B. start calendar")
- print("C. import calendar")
- print("D. input calendar")
- Q5answer="C"
- Q5response=input("Your answer: ")
- if(Q5response!=Q5answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q5response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question six: What does \ t do?")
- print("A. It puts a tab of space behind text.")
- print("B. It moves text a line down.")
- print("C. It moves text to the left.")
- print("D. It adds a double quote.")
- Q6answer="A"
- Q6response=input("Your answer: ")
- if(Q6response!=Q6answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q6response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question seven: What does \ ' do?")
- print("A. It moves text to the left.")
- print("B. It adds a double quote.")
- print("C. It moves text to the right.")
- print("D. It adds a single quote.")
- Q7answer="D"
- Q7response=input("Your answer: ")
- if(Q7response!=Q7answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q7response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question eight: Which of the following comparisons means 'equal to' in python?")
- print("A. +=")
- print("B. ==")
- print("C. !=")
- print("D. =")
- Q8answer="B"
- Q8response=input("Your answer: ")
- if(Q8response!=Q8answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q8response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question nine: Which of the following comparisons means 'not equal to' in python?")
- print("A. !=")
- print("B. ==")
- print("C. +=")
- print("D. -=")
- Q9answer="A"
- Q9response=input("Your answer: ")
- if(Q9response!=Q9answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q9response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question ten: Which of the following comparisons means 'greater than' in python?")
- print("A. <=")
- print("B. >")
- print("C. >=")
- print("D. <")
- Q10answer="B"
- Q10response=input("Your answer: ")
- if(Q10response!=Q10answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q10response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question eleven: Which of the following comparisons means 'less than or equal to' in python?")
- print("A. >")
- print("B. <=")
- print("C. =<")
- print("D. >=")
- Q11answer="B"
- Q11response=input("Your answer: ")
- if(Q11response!=Q11answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q11response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question twelve: Which of the following comparisons means 'greater than or equal to' in python?")
- print("A. >=")
- print("B. >")
- print("C. <")
- print("D. =>")
- Q12answer="A"
- Q12response=input("Your answer: ")
- if(Q12response!=Q12answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q12response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question thirteen: Which of the following operators multiplies in python?")
- print("A. /")
- print("B. x")
- print("C. *")
- print("D. +")
- Q13answer="C"
- Q13response=input("Your answer: ")
- if(Q13response!=Q13answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q13response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question fourteen: Which of the following operators makes an exponent in python?")
- print("A. */")
- print("B. *+")
- print("C. *x")
- print("D. **")
- Q14answer="D"
- Q14response=input("Your answer: ")
- if(Q14response!=Q14answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q14response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print ('\n-----------------------------------------------------------\n')
- print("Question fifteen: Which of the following operators divides in python?")
- print("A. /*")
- print("B. -+")
- print("C. /")
- print("D. *-")
- Q15answer="C"
- Q15response=input("Your answer: ")
- if(Q15response!=Q15answer):
- print("Incorrect")
- else:
- print("Correct! The answer is " +Q15response+ ".")
- score=score+1
- print("Your current score is now " +str(score)+ " out of 15.")
- print("\nThank you for taking my quiz!\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement