gs gs109 Python Functions - Python Function - Quiz No.4
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Functions. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: What is a variable defined outside a function referred to as?
A static variable
A global variable
A local variable
An automatic variable
Question 2: What is a variable defined inside a function referred to as?
A global variable
A volatile variable
A local variable
An automatic variable
Question 3: What will be the output of the following Python code?
i=0 def change(i): i=i+1 return i change(1) print(i)
1
Nothing is displayed
0
An exception is thrown
Question 6: What will be the output of the following Python code?
def change(i = 1, j = 2): i = i + j j = j + 1 print(i, j) change(j = 1, i = 2)
An exception is thrown because of conflicting values
1 2
3 3
3 2
Question 7: What will be the output of the following Python code?
def change(one, *two): print(type(two)) change(1,2,3,4)
Integer
Tuple
Dictionary
An exception is thrown
Question 8: If a function doesn’t have a return statement, which of the following does the function return?
int
null
None
An exception is thrown without the return statement
Question 9: What will be the output of the following Python code?
def display(b, n): while n > 0: print(b,end="") n=n-1 display('z',3)
zzz
zz
An exception is executed
Infinite loop
Question 10: What will be the output of the following Python code?
def find(a, **b): print(type(b)) find('letters',A='1',B='2')
String
Tuple
Dictionary
An exception is thrown