Python Function MCQ – 1

Q1) Is Python case sensitive when dealing with identifiers?

a) yes
b) no
c) machine dependent
d) none of the mentioned

View Answer Answer:- a) yes

The case is always significant.

Q2) All keywords in Python are in __.

a) lower case
b) UPPER CASE
c) Capitalized
d) None of the mentioned

View Answer Answer:- d) None of the mentioned

True, False, and None are capitalized while the others are in lower case.

Q3) Which keyword is used for function?

a) Fun
b) Define
c) Def
d) Function

View Answer Answer:- c) Def

Q4) Python function always returns a value.

a) True
b) False

View Answer Answer:- a) True

If you do not include any return statement in the Python function, it automatically returns None. So, a python function always returns a value.

Q5) Where is the function defined?

a) Module
b) Class
c) Another function
d) All of the mentioned

View Answer Answer:- d) All of the mentioned

Q6) What do we use to define a block of code in Python language?

a) Key
b) Brackets
c) Indentation
d) None of these

View Answer Answer:- c) Indentation

Q7) How is a function declared in Python?

a) def function function_name():
b) declare function function_name():
c) def function_name():
d) declare function_name():

View Answer Answer:- c) def function_name():

Q8) If the return statement is not used inside the function, the function will return:

a) None
b) 0
c) Null
d) Arbitrary value

View Answer Answer:- a) None

Q9) Which of the following is the use of the id() function in python?

a) Id() returns the size of the object.
b) Id() returns the identity of the object.
c) Both A and B
d) None of the above

View Answer Answer:- b) Id() returns the identity of the object.

Q10) Which of the following is the use of function in python?

a) Functions are reusable pieces of programs
b) Functions don’t provide better modularity for your application
c) you can’t also create your own functions
d) All of the mentioned

View Answer Answer:- a) Functions are reusable pieces of programs

Q11) You can also create your own functions, these functions are called?

a) py function
b) user-defined functions
c) built-in functions
d) None of the above

View Answer Answer:- b) user-defined functions

Also See:- MCQ on Python Functions – 2

Leave a Comment

Your email address will not be published.