function in python

Quiz
•
Computers
•
12th Grade
•
Hard
Puneet Kohli
Used 77+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the default return value for a function that does not return a value explicitly?
None
int
double
null
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following items are present in the function header?
Function name only
Both function name and parameter list
parameter list only
Return value
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following keywords marks the begining of the function block?
Func
define
def
function
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the name given to that area of memory, where the system stores the parameters and local variables of a function call?
a heap
storage area
a stack
an array
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What Is The Output Of The Following Code Snippet?
def func(message, num = 1):
print(message * num)
func('Welcome')
func('Viewers', 3)
Welcome
Viewers
Welcome
ViewersViewersViewers
Welcome
Viewers,Viewers,Viewers
Welcome
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What Is The Output Of The Following Code Snippet?
def func(message, num = 1):
print(message * num)
func('Welcome')
func('Viewers', 3)
Welcome
Viewers
Welcome
ViewersViewersViewers
Welcome
Viewers,Viewers,Viewers
Welcome
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Fill in the line of code for calculating the factorial of a number.
def fact(num):
if num == 0:
return 1
else:
return _____________________
num*fact(num-1)
(num-1)*(num-2)
num*(num-1)
fact(num)*fact(num-1)
Create a free account and access millions of resources
Similar Resources on Wayground
16 questions
DATA SCIENCE Assessment (April)

Quiz
•
8th - 12th Grade
24 questions
Логикалык операторлор жана структуралар

Quiz
•
6th Grade - University
17 questions
Cuestionario de Certificación JS 2024

Quiz
•
12th Grade
20 questions
Basic JavaScript Review

Quiz
•
9th - 12th Grade
18 questions
AP Computer Science A Post Unit 2 Check

Quiz
•
10th Grade - University
20 questions
Intro to JavaScript

Quiz
•
9th - 12th Grade
15 questions
Python revision

Quiz
•
10th Grade - University
15 questions
Functions and Parameters Quiz

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade