print("Hello World!")
Hello World!
msg = input("Enter a greeting: ")
print(msg)
this is my quiz
def question_and_answer(prompt):
    print("Question: " + prompt)
    msg = input()
    print("Answer: " + msg)

question_and_answer("Name the Python output command mentioned in this lesson?")
question_and_answer("If you see many lines of code in order, what would College Board call it?")
question_and_answer("Describe a keyword used in Python to define a function?")
Question: Name the Python output command mentioned in this lesson?
Answer: prompt
Question: If you see many lines of code in order, what would College Board call it?
Answer: sequence
Question: Describe a keyword used in Python to define a function?
Answer: def
import getpass, sys

def question_with_response(prompt):
    print("Question: " + prompt)
    msg = input()
    return msg

questions = 3
correct = 0

print('Hello, ' + getpass.getuser() + " running " + sys.executable)
print("You will be asked " + str(questions) + " questions.")
question_and_answer("Are you ready to take a test?")

rsp = question_with_response("What command is used to include other functions that were previously developed?")
if rsp == "import":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What command is used to evaluate correct or incorrect response in this example?")
if rsp == "if":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("Each 'if' command contains an '_________' to determine a true or false condition?")
if rsp == "expression":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

print(getpass.getuser() + " you scored " + str(correct) +"/" + str(questions))
Hello, dmsol running /Library/Developer/CommandLineTools/usr/bin/python3
You will be asked 3 questions.
Question: Are you ready to take a test?
Answer: yes
Question: What command is used to include other functions that were previously developed?
import is correct!
Question: What command is used to evaluate correct or incorrect response in this example?
if is correct!
Question: Each 'if' command contains an '_________' to determine a true or false condition?
expression is correct!
dmsol you scored 3/3

Disney Themed Quiz

import getpass, sys

def question_with_response(prompt):
    print("Question: " + prompt)
    msg = input()
    return msg

questions = 4
correct = 0

print('Hello, ' + getpass.getuser() + " running " + sys.executable)
print("You will be asked " + str(questions) + " questions.")

rsp = question_with_response("What does Hakuna Matata mean?")
if rsp == "no worries":
    print(rsp + " is right!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What was the first Disney Princess to have a movie?")
if rsp == "Snow White":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

rsp = question_with_response("What was the name of Simba's father in the Lion King?")
if rsp == "Mufasa":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")
    
rsp = question_with_response("What was the first animated movie to be nominated for Best Picture at the Oscars?")
if rsp == "Beauty and the Beast":
    print(rsp + " is correct!")
    correct += 1
else:
    print(rsp + " is incorrect!")

Percentage = correct/4
print("You got " +str(int(Percentage*100))+"%")
Hello, dmsol running /Library/Developer/CommandLineTools/usr/bin/python3
You will be asked 4 questions.
Question: What does Hakuna Matata mean?
no worries is right!
Question: What was the first Disney Princess to have a movie?
Cinderella is incorrect!
Question: What was the name of Simba's father in the Lion King?
Mufasa is correct!
Question: What was the first animated movie to be nominated for Best Picture at the Oscars?
Beauty and the Beast is correct!
You got 75%