[Quiz] Python Function
Quiz
•
Information Technology (IT)
•
University
•
Medium
Fatin Hanani
Used 10+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax for defining a function in Python?
def function_name:
function function_name():
define function_name()
def function_name():
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the return statement do in a function?
It ends the function and sends a value back.
It defines the input parameters of a function.
It prints the output to the console.
It loops through the function.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Parameters are values passed to a function when it is called.
True
False
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the function:
def greet(name):
return "Hello, " + name
What will greet("Alice") output?
Hello, Alice
Hello, name
"Hello, Alice"
Alice
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which variable is accessible both inside and outside of functions?
Local variable
Global variable
Input variable
Parameter variable
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Variables defined inside a function have a local scope.
True
False
7.
FILL IN THE BLANK QUESTION
1 min • 1 pt
Write a function named add_two_numbers that takes two parameters, a and b, and returns their sum.
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Abstracciones procedimentales
Quiz
•
University
13 questions
Session 15 + 16 : Function
Quiz
•
University
16 questions
HTML Level 1
Quiz
•
8th Grade - University
15 questions
Web Application - PHP Repetition
Quiz
•
University
11 questions
JavaEE-servlets-jsp
Quiz
•
University
15 questions
Huawei Security
Quiz
•
University
10 questions
Diagnóstico de Algoritmos y Fundamentos de Programacion
Quiz
•
University
12 questions
3H_Verifica teorica_Basi di comunicazione
Quiz
•
11th Grade - University
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Information Technology (IT)
10 questions
Halloween Movies Trivia
Quiz
•
5th Grade - University
12 questions
Halloween
Quiz
•
3rd Grade - University
5 questions
Using Context Clues
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
Eat Healthy,Be Healty
Quiz
•
4th Grade - University
7 questions
History of Halloween: Pagan or Christian?
Interactive video
•
11th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
