
Python-Functions

Quiz
•
Computers
•
9th Grade
•
Medium
Zubaidah Shaheen
Used 1+ times
FREE Resource
17 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to call a function named print_sum?
def print_sum():
print_sum
print_sum():
print_sum()
Answered
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to declare a function in Python?
print_hello:
print("hello")
function print_hello():
print("hello")
print_hello():
print("hello")
def print_hello():
print("hello")
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following code samples correctly passes the number 10 as an argument to the function print_number?
print_number(10)
print_number()
print 10
10(print_number)
print print_number
print 10
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following code samples correctly creates a function that takes a single parameter and prints it?
def print_number(x):
print(x)
def print_number():
print(parameter)
def print_number():
print(x)
def print(x)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In which namespace is the variable ‘x’ defined in the following program?
Function namespace
Global namespace
Object namespace
Class namespace
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider this code snippet.
Which of the following additional functions could be safely added to this code, without causing an error?
def subtract_nums():
z = x - y
print(z)
def subtract_nums():
z = z - x
print(z)
def subtract_nums():
y = 5
z = x - y
print(z)
def subtract_nums():
z = y
z = x - y
print(z)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following functions successfully returns the number 10?
def my_function():
10
def my_function(10):
return
def my_function():
return 10
def my_function():
print(10)
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Ch.8 - Introducing Python

Quiz
•
6th Grade - Professio...
16 questions
function & procedures

Quiz
•
9th Grade
15 questions
Hangman Game - Programming Questions

Quiz
•
7th - 11th Grade
17 questions
Python

Quiz
•
6th - 10th Grade
12 questions
Python Сестрорецк №10 Тест по функциям

Quiz
•
9th - 12th Grade
18 questions
Computer Science (Python)

Quiz
•
9th Grade
15 questions
Python - Chpt 1 - Review

Quiz
•
9th - 12th Grade
20 questions
SST Yr8 - NCCE - Programming

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade