
Python Subroutines Basics Quiz

Quiz
•
Fun
•
Professional Development
•
Medium
Mr Massett
Used 3+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword is used to define a function in Python?
`function`
`define`
`def`
`func`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will happen if a function does not include a `return` statement?
It will cause a syntax error.
It will return `None` by default.
It will return `0`.
It will return an empty string.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly defines a function in Python?
`function greet(): print("Hello")`
`def greet(): print("Hello")`
`define greet(): print("Hello")`
`greet() = def(): print("Hello")`
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you call a function named `calculate_area` with two arguments (5, 10)?
`calculate_area[5, 10]`
`calculate_area{5, 10}`
`calculate_area(5, 10)`
`calculate_area -> (5, 10)`
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of parameters in a function?
To store global variables.
To pass values into a function.
To create an infinite loop.
To return multiple values.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following function return? ```python def multiply(x, y): return x * y print(multiply(3, 4)) ```
`7`
`12`
`34`
`None`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the difference between a function and a procedure in Python?
A function always returns a value, whereas a procedure does not.
A procedure must take arguments, but a function does not.
A function can only have one line of code, but a procedure can have multiple lines.
There is no difference; they are the same.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Barretts quiz

Quiz
•
Professional Development
15 questions
Let's gain confidence to learn

Quiz
•
Professional Development
15 questions
TOEIC A - 1

Quiz
•
University - Professi...
15 questions
Propel: Summer Primer

Quiz
•
Professional Development
10 questions
Seberapa Retail Ops kah Kamu

Quiz
•
Professional Development
15 questions
TV and Patchwall Overview

Quiz
•
Professional Development
10 questions
COE BI-WEEKLY

Quiz
•
Professional Development
20 questions
Python Basics Quiz

Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade