I. Choose the best answer (I Marks)<\/span><\/p>\nQuestion 1.
\nA named blocks of code that are designed to do one specific job is called as
\na) Loop
\nb) Branching
\nc) Function
\nd) Block
\nAnswer:
\nc) Function<\/p>\n
Question 2.
\nA Function which calls itself is called as
\na) Built-in
\nb) Recursion
\nc) Lambda
\nd) return
\nAnswer:
\nb) Recursion<\/p>\n
<\/p>\n
Question 3.
\nWhich function is called anonymous un-named function PTA –
\na) Lambda
\nb) Recursion
\nc) Function
\nd) define
\nAnswer:
\na) Lambda<\/p>\n
Question 4.
\nWhich of the following keyword is used to begin the function block?
\na) define
\nb) for
\nc) finally
\nd) def
\nAnswer:
\nd) def<\/p>\n
<\/p>\n
Question 5.
\nWhich of the following keyword is used to exit a function block?
\na) define
\nb) return
\nc) finally
\nd) def
\nAnswer:
\nb) return<\/p>\n
Question 6.
\nWhile defining a function which of the following symbol is used.
\na) ; (semicolon)
\nb) . (dot)
\nc) : (colon)
\nd) $ (dollar)
\nAnswer:
\nc): (colon)<\/p>\n
Question 7.
\nIn which arguments the correct positional order is passed to a function?
\na) Required
\nb) Keyword
\nc) Default’
\nd) Variable-length
\nAnswer:
\na) Required<\/p>\n
<\/p>\n
Question 8.
\nRead the following statement and choose the correct statement(s).
\nI) In Python, you don’t have to mention the specific data types while defining function.
\nII) Python keywords can be used as function name.
\na) I is correct and II is wrong
\nb) Both are correct
\nc) I is wrong and II is correct
\nd) Both are wrong
\nAnswer:
\na) I is correct and II is wrong<\/p>\n
Question 9.
\nPick the correct one to execute the given statement successfully, if ………… : print
\n(x, ” is a leap year”)
\na) x%2=0
\nb) x%4==0
\nc) x\/4=0
\nd) x%4=0
\nAnswer:
\nb) x%4==0<\/p>\n
<\/p>\n
Question 10.
\nWhich of the following keyword is used to define the function testpython(): ?
\na) define
\nb) pass
\nc) def
\nd) while
\nAnswer:
\nc) def<\/p>\n
II. Answer the following questions (2 Marks)<\/span><\/p>\nQuestion 1.
\nWhat is a function?
\nAnswer:
\nFunctions are named blocks of code that are designed to do a specific job. If you need to perform that task multiple times throughout your program, you just call the function dedicated to handling that task.<\/p>\n
Question 2.
\nWrite the different types of functions.
\nAnswer:<\/p>\n
\n- User-defined functions<\/li>\n
- Built-in functions<\/li>\n
- Lambda functions<\/li>\n
- Recursive functions<\/li>\n<\/ol>\n
<\/p>\n
Question 3.
\nWhat are the main advantages of function?
\nAnswer:<\/p>\n