python functions
Quiz
•
Computers
•
10th Grade
•
Hard
Kasun Jayasekara
Used 11+ times
FREE Resource
33 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used for functions?
func
def
define
function
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of this program?
def addOne(number):
number += 1
return number
one = addOne(0)
two = addOne(one)
print(two)
0
1
2
3
4
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of this program?
def hello():
print(“I am a beginner”)
hello()
hello()
I am a beginner
I am a beginner I am a beginner
Hello
Hello
Hello
I am a beginner
I am a beginner
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
When a variable is inside of a function what do you call its scope?
Static
Local
Global
Boolean
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a function?
They are reusable pieces of programs.
They are required by the Python
They allow us to compile our program
They make the program larger
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is missing in the following code?
def sumA(count):
a = count+1
return a
print(a)
The initialization of variable a
A function call
The declaration of the global variable a
The print statement inside the function
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of this program?
def printmessage(message, ntimes = 1):
print(message * ntimes)
printmessage(“Hello”)
printmessage(“Hello”, 5)
Hello
Hello Hello 5
Hello Hello
Hello
HelloHelloHelloHelloHello
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
28 questions
PAS PRAKARYA-TIK KELAS 9
Quiz
•
10th Grade
35 questions
Micro:bit
Quiz
•
1st Grade - University
37 questions
Algorithm: Flowcharts
Quiz
•
8th - 10th Grade
32 questions
Sec 2.2 Direct Data Entry and Its Associated Device
Quiz
•
9th - 11th Grade
31 questions
Year 7 Computer Science Baseline
Quiz
•
KG - Professional Dev...
30 questions
Scratch Exam New
Quiz
•
9th - 12th Grade
30 questions
G10 - Ôn tập cuối kì mùa Xuân
Quiz
•
10th Grade
30 questions
[AP CSP] Midterm Review (Semester 1)
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
20 questions
ELA Advisory Review
Quiz
•
7th Grade
15 questions
Subtracting Integers
Quiz
•
7th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials
Interactive video
•
6th - 10th Grade
