
ONE 6th FORM Basic Python Functions
Authored by Lorna Jarrett
Computers
12th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to define a function in Python?
`function myFunction():`
`def myFunction():`
`define myFunction():`
`func myFunction():`
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid function call for a function defined as `def add(a, b):`?
`add(5)`
`add(5, 10)`
`add()`
`add(5, 10, 15)`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following function call if the function is defined as `def multiply(x, y=2): return x * y` and called as `multiply(3)`?
3
6
9
12
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a return statement in a function?
To print the result
To exit the function and return a value
To define a function
To pass arguments to a function
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```python def subtract(a, b): return a - b result = subtract(10, 5) print(result) ```
5
10
15
0
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements about variable scope is true?
Variables defined inside a function are global.
Variables defined inside a function are local to that function.
Variables defined inside a function can be accessed from anywhere in the program.
Variables defined inside a function are automatically global.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```python x = 10 def change_x(): x = 5 change_x() print(x) ```
5
10
15
Error
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
15 questions
Vocabulary of Computer
Quiz
•
12th Grade
20 questions
Ôn tập học kỳ I
Quiz
•
9th - 12th Grade
15 questions
Asesmen Sumatif
Quiz
•
12th Grade
10 questions
Intro to Windows Server 2012
Quiz
•
12th Grade
20 questions
UNIT 3- DATA COMMUNICATION
Quiz
•
12th Grade
20 questions
System Computer : Al-Azhar
Quiz
•
9th - 12th Grade
10 questions
Khởi động
Quiz
•
9th - 12th Grade
15 questions
History of Computers
Quiz
•
6th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade