gs gs109 Python Functions - Python Function - Quiz No.2
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: Which are the advantages of functions in python?
Reducing duplication of code
Decomposing complex problems into simpler pieces
Improving clarity of the code
All of the mentioned
Question 2: What are the two main types of functions?
Custom function
Built-in function & User defined function
User function
System function
Question 3: Where is function defined?
Module
Class
Another function
All of the mentioned
Question 4: What is called when a function is defined inside a class?
Module
Class
Another function
Method
Question 5: Which of the following is the use of id() function in python?
Id returns the identity of the object
Every object doesn’t have a unique id
All of the mentioned
None of the mentioned
Question 6: Which of the following refers to mathematical function?
sqrt
rhombus
add
rhombus
Question 8: What will be the output of the following Python code?
def C2F(c): return c * 9/5 + 32 print C2F(100) print C2F(0)
212 32
314 24
567 98
None of the mentioned
Question 9: What will be the output of the following Python code?
def power(x, y=2): r = 1 for i in range(y): r = r * x return r print power(3) print power(3, 3)
212 32
9 27
567 98
None of the mentioned
Question 10: What will be the output of the following Python code?
def sum(*args): '''Function returns the sum of all values''' r = 0 for i in args: r += i return r print(sum.__doc__) print(sum(1, 2, 3)) print(sum(1, 2, 3, 4, 5))
Function returns the sum of all values 6 15
6 100
123 12345
None of the mentioned