This is my first program that uses more than just boring ol' if
/else
statements - I made a whole 246 line game that's still a work in progress simply using if
/else
- and I'm going to email this to my teacher later tonight.
Please suggest more things I can add and report any bugs (although I've found none so far).
# Starting points value
points = 0
# correct() calls this
def correct():
global points
points = points + 1
print("Correct!")
print("You have",points,"points!")
a = input()
# incorrect() calls this
def incorrect():
print("Incorrect!")
ab = input()
print("Welcome to this five question general IT quiz!")
print("If you're stuck and need help, type 'Hint'!")
a = input()
# Question 1
print("Question one:")
q1 = input("What does LAN stand for?")
if q1 == "Hint":
print("The N stands for network...")
q1 = input("What does LAN stand for?")
elif q1 == "hint":
print("The N stands for network...")
q1 = input("What does LAN stand for?")
if q1 == "Local Area Network":
correct()
elif q1 == "local area network":
correct()
elif q1 == "Local area network":
correct()
elif q1 == "Local area Network":
correct()
else:
incorrect()
# Question 2
print("Question 2:")
print("Fill in the blank.")
q2 = input("A monitor is an example of an ------ device.")
if q2 == "Hint":
print("Another example would be speakers or headphones.")
q2 = input("A monitor is an example of an ------ device.")
elif q2 == "hint":
print("Another example would be speakers or headphones.")
q2 = input("A monitor is an example of an ------ device.")
if q2 == "Output":
correct()
elif q2 == "output":
correct()
else:
incorrect()
# Question 3
print("Question 3:")
q3 = input("True or false: To connect to the internet, you MUST have an ethernet cable connected from your router to your PC.")
if q3 == "Hint":
print("Remember, there are two types of internet connecttion.")
q3 = input("True or false: To connect to the internet, you MUST have an ethernet cable connected from your router to your PC.")
elif q3 == "hint":
print("Remember, there are two types of internet connecttion.")
q3 = input("True or false: To connect to the internet, you MUST have an ethernet cable connected from your router to your PC.")
if q3 == "False":
correct()
elif q3 == "false":
correct()
else:
incorrect()
# Question 4
print("Question 4:")
q4 = input("What is the processor made by Intel that is used in PCs designed for networking/server hosting?")
if q4 == "Hint":
print("Begins with an X!")
q4 = input("What is the processor made by Intel that is used in PCs designed for networking/server hosting?")
elif q4 == "hint":
print("Begins with an X!")
q4 = input("What is the processor made by Intel that is used in PCs designed for networking/server hosting?")
if q4 == "Xeon":
correct()
elif q4 == "xeon":
correct()
else:
incorrect()
# Final Question
print("Final question:")
q5 = input("Radeon, EVGA, XFX and Sapphire are companies that make what computer component?")
if q5 == "Hint":
print("A better one of these will boost grapical performance and framerate in games.")
q5 = input("Radeon, EVGA, XFX and Sapphire are companies that make what computer component?")
elif q5 == "hint":
print("A better one of these will boost grapical performance and framerate in games.")
q5 = input("Radeon, EVGA, XFX and Sapphire are companies that make what computer component?")
if q5 == "graphics cards":
correct()
elif q5 == "Graphics Cards":
correct()
elif q5 == "GPUs":
correct()
elif q5 == "gpus":
correct()
elif q5 == "graphics card":
correct()
elif q5 == "Graphics Card":
correct()
elif q5 == "gpu":
correct()
elif q5 == "GPU":
correct()
else:
incorrect()
# End of the quiz
print("The quiz is over! You scored",points,"points!")
if points >= 4:
print("Pretty good!")
if points == 3:
print("Not bad...")
if points == 2:
print("Meh.")
if points < 2:
print("Boo! Try again!")
b = input()