function in python

Quiz
•
Computers
•
12th Grade
•
Hard
Puneet Kohli
Used 78+ 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
15 questions
Lesson 5 Looping Quiz

Quiz
•
10th - 12th Grade
16 questions
Python есептер 1

Quiz
•
9th - 12th Grade
15 questions
Area and Arrays

Quiz
•
10th - 12th Grade
15 questions
Java Script Quiz

Quiz
•
9th - 12th Grade
15 questions
Большое Повторение C#

Quiz
•
5th Grade - University
15 questions
Javascript Basics Quiz Review

Quiz
•
12th Grade
21 questions
Visual Basic Assessment

Quiz
•
11th - 12th Grade
15 questions
Python - тест

Quiz
•
1st - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade