Assessment 5
Open course
Started on Thursday, 11 July 2024, 5:59 AM
State Finished
Completed on Friday, 11 July 2024, 6:22 AM
Time taken 22 mins 42 secs
Marks 14.00/15.00
Grade 93.33 out of 100.00
Question 1
Complete
Not graded
Flag question
Question text
Marked out of 1.00
What code is generated when the following code is executed?
def myPet(pType,pName):
print('I have a %s named %s.' %(pType.lower(), pName.title()))
petType = str(input("What type of pet do you have? "))
petName = str(input("What is the name of your pet? "))
myPet(petType, petName)
a.What type of pet do you have? CAT
What is the name of your pet? FRED
I have a CAT named FRED.
b.What type of pet do you have? CAT
What is the name of your pet? FRED
, I have a cat named Fred.
c.What type of pet do you have? CAT
What is the name of your pet? FRED
I have a Cat named Fred.
d.What type of pet do you have? CAT
What is the name of your pet? FRED
I Have A Cat Named Fred.
Question 2
The variables in the function that receive the arguments are called _____.
a.globals
b.modules
c.parameters
d.returns
Question 3
A _____ function is a function that is small (usually only a single line), and is used only once.
a.argument
b.module
Open course
Started on Thursday, 11 July 2024, 5:59 AM
State Finished
Completed on Friday, 11 July 2024, 6:22 AM
Time taken 22 mins 42 secs
Marks 14.00/15.00
Grade 93.33 out of 100.00
Question 1
Complete
Not graded
Flag question
Question text
Marked out of 1.00
What code is generated when the following code is executed?
def myPet(pType,pName):
print('I have a %s named %s.' %(pType.lower(), pName.title()))
petType = str(input("What type of pet do you have? "))
petName = str(input("What is the name of your pet? "))
myPet(petType, petName)
a.What type of pet do you have? CAT
What is the name of your pet? FRED
I have a CAT named FRED.
b.What type of pet do you have? CAT
What is the name of your pet? FRED
, I have a cat named Fred.
c.What type of pet do you have? CAT
What is the name of your pet? FRED
I have a Cat named Fred.
d.What type of pet do you have? CAT
What is the name of your pet? FRED
I Have A Cat Named Fred.
Question 2
The variables in the function that receive the arguments are called _____.
a.globals
b.modules
c.parameters
d.returns
Question 3
A _____ function is a function that is small (usually only a single line), and is used only once.
a.argument
b.module