import getpass, sys
def qanda(question):
print(question)
response = input()
return response
correctAnswers = 0
questions = 0
print('Hi ' + getpass.getuser() + " running " + sys.executable)
currentQuestion = qanda("What evaluates if something is true or false")
if currentQuestion == "if":
print("correct")
correctAnswers += 1
else:
print("nuh uh" + currentQuestion + " is wrong")
questions += 1
currentQuestion = qanda("if statements use _____ to determine if something is true or false")
if currentQuestion == "condition":
print("correct")
correctAnswers += 1
else:
print("nuh uh" + currentQuestion + " is wrong")
questions += 1
currentQuestion = qanda("what is a essentially a block of code callable at any time in Python")
if currentQuestion == "def":
print(currentQuestion + " is correct!")
correctAnswers += 1
else:
print(currentQuestion + " is not correct!")
questions += 1
print(getpass.getuser() + " you got a " + str(correctAnswers) +"/" + str(questions))
Hi Jonli running C:\Users\Jonli\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe
What evaluates if something is true or false
correct
if statements use _____ to determine if something is true or false
correct
what is a essentially a block of code callable at any time in Python
def is correct!
Jonli you got a 3/3