Menu mobile
Home
Programming
Python Tutorial
Java Tutorial
C Tutorial
C++ Tutorial
Web Technology
HTML
CSS
Java Script
PHP
React JS
Node JS
Assignment
MS Office
HTML
CSS
Bootstrap
Java Script
JQuery
AngularJs
Project
Blog
QUIZ ON : python - FUNCTIONS IN PYTHON
FUNCTIONS IN PYTHON
00:00:00
English
Hindi
Question No# :
01
out of 50
What is the main advantage of using functions?
फंक्शन का उपयोग करने का मुख्य लाभ क्या है?
A.
Increases code duplication
Increases code duplication
B.
Reduces code reusability
Reduces code reusability
C.
Promotes code reusability and modularity
Promotes code reusability and modularity
D.
Makes program slower
Makes program slower
Question No# :
02
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">def foo():<br></span><span style="font-size: 14px;"> return total + 1<br></span><span style="font-size: 14px;">total = 0<br></span><span style="font-size: 14px;">print(foo())</span></pre>
<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def foo():<br></span><span style="font-size: 14px;"> return total + 1<br></span><span style="font-size: 14px;">total = 0<br></span><span style="font-size: 14px;">print(foo())</span></pre>
A.
0
0
B.
1
1
C.
error
एरर
D.
none of the mentioned
उल्लेखित कोई नहीं
Question No# :
03
out of 50
<p>What is the output of the following?</p><pre>x=123<br>for i in x:<br> print(i)</pre><div><br></div>
<p>निम्नलिखित का आउटपुट क्या है?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">x=123<br>for i in x:<br> print(i)</pre>
A.
1 2 3
1 2 3
B.
123
123
C.
Error
Error
D.
none of these
इनमें से कोई नहीं
Question No# :
04
out of 50
<p>What will be the output?</p><pre><span style="font-size: 14px;">def fun(a, b=5):<br></span><span style="font-size: 14px;"> print(a+b)<br></span><span style="font-size: 14px;">fun(10, 20)</span></pre>
<p>इसका परिणाम क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def fun(a, b=5):<br></span><span style="font-size: 14px;"> print(a+b)<br></span><span style="font-size: 14px;">fun(10, 20)</span></pre>
A.
15
15
B.
30
30
C.
25
25
D.
Error
Error
Question No# :
05
out of 50
Structured program can be broken into to assign to more than one developer
एक से अधिक डेवलपर को असाइन करने के लिए संरचित प्रोग्राम को खंडित किया जा सकता है
A.
Segments
सेग्मेंट्स
B.
Modules
मॉडुल्स
C.
Units
यूनिट्स
D.
All the above
उपरोक्त सभी
Question No# :
06
out of 50
Which of the following functions does not throw an error?
निम्नलिखित में से कौन सा फंक्शन एरर नहीं देता है?
A.
ord()
ord()
B.
ord(‘ ‘)
ord(‘ ‘)
C.
ord(”)
ord(”)
D.
ord(“”)
ord(“”)
Question No# :
07
out of 50
<p>What is the output of the following code?</p><pre>def s(n1):<br> print(n1)<br> n1=n1+2<br>n2=4<br>s(n2)<br>print(n2)</pre><div><br></div>
<p>निम्नलिखित कोड का परिणाम क्या है?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">def s(n1):<br> print(n1)<br> n1=n1+2<br>n2=4<br>s(n2)<br>print(n2)</pre>
A.
6 4
6 4
B.
4 6
4 6
C.
4 4
4 4
D.
6 6
6 6
Question No# :
08
out of 50
You can also create your own functions, these functions are called?
आप अपने खुद के फंक्शन भी बना सकते हैं, इन फंक्शन्स को क्या कहते हैं?
A.
built-in functions
built-in functions
B.
user-defined functions
user-defined functions
C.
py function
py function
D.
None of the above
इनमें से कोई नहीं
Question No# :
09
out of 50
<p>What is the output of the following code ?</p><pre>def add(a, b):<br> return a+5, b+5<br>result = add(3,2)<br>print(result)</pre><div><br></div>
<p>निम्नलिखित कोड का परिणाम क्या है ?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">def add(a, b):<br> return a+5, b+5<br>result = add(3,2)<br>print(result)</pre>
A.
15
15
B.
8
8
C.
(8,7)
(8,7)
D.
Error
Error
Question No# :
10
out of 50
Which keyword is used for function in Python language?
पायथन भाषा में फंक्शन के लिए कौन सा कीवर्ड प्रयोग किया जाता है?
A.
function
function
B.
def
def
C.
fun
fun
D.
define
define
Question No# :
11
out of 50
Which of these is not true about recursion?
इनमें से कौन सा रिकर्शन के बारे में सच नहीं है?
A.
It’s easier to code some real-world problems using recursion than non-recursive equivalent
नॉन-रिकर्सिव समकक्ष की तुलना में रिकर्शन का यूज़ करके कुछ रियल-वर्ल्ड की प्रॉब्लम्स को कोड करना आसान है
B.
Recursive functions are easy to debug
रिकर्सिव फ़ंक्शन को डीबग करना आसान है
C.
Recursive calls take up a lot of memory
रिकर्सिव कॉल बहुत सारी मेमोरी लेती हैं
D.
Programs using recursion take longer time than their non-recursive equivalent
रिकर्शन का यूज़ करने वाले प्रोग्राम अपने नॉन-रिकर्सिव समकक्ष की तुलना में अधिक समय लेते हैं
Question No# :
12
out of 50
The values which are passed to a function definition are called
वे मान जो किसी फ़ंक्शन परिभाषा में पारित किए जाते हैं, कहलाते हैं
A.
Arguments
Arguments
B.
Subroutines
Subroutines
C.
Function
Function
D.
Definition
Definition
Question No# :
13
out of 50
<p>What will be the output of following?</p><pre><span style="font-size: 14px;">Y=[2,5J,6]<br></span><span style="font-size: 14px;">Y.sort()</span></pre>
<p>निम्नलिखित का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">Y=[2,5J,6]<br></span><span style="font-size: 14px;">Y.sort()</span></pre>
A.
[2,6,5J]
[2,6,5J]
B.
[5J,2,6]
[5J,2,6]
C.
Error
Error
D.
[6,5J,2]
[6,5J,2]
Question No# :
14
out of 50
Which of the following functions is a built-in function in python?
निम्नलिखित में से कौन सा फ़ंक्शन पायथन में एक अंतर्निहित फ़ंक्शन है?
A.
seed()
सीड()
B.
sqrt()
sqrt()
C.
factorial()
फैक्टोरीअल()
D.
print()
प्रिंट ()
Question No# :
15
out of 50
def keyword use for?
def कीवर्ड का उपयोग किसके लिए किया जाता है?
A.
Define keyword in python
Define keyword in python
B.
Define variable in python
Define variable in python
C.
Define function in python
Define function in python
D.
All of the above
ऊपर के सभी
Question No# :
16
out of 50
Which of the following is TRUE about lambda functions?
लैम्डा फंक्शन के बारे में निम्नलिखित में से कौन सा कथन सत्य है?
A.
Can contain multiple statements
Can contain multiple statements
B.
Can have only one expression
Can have only one expression
C.
Must use return statement
Must use return statement
D.
Cannot take arguments
Cannot take arguments
Question No# :
17
out of 50
What is recursion?
रिकर्सन क्या है?
A.
Calling one function from another function
Calling one function from another function
B.
Calling a function repeatedly from itself
Calling a function repeatedly from itself
C.
Using nested loops
Using nested loops
D.
Using lambda functions
Using lambda functions
Question No# :
18
out of 50
<p>find the output of following code:</p><pre><span style="font-size: 14px;">def add(a,b):<br></span><span style="font-size: 14px;"> return(a+b)<br></span><span style="font-size: 14px;">print(add(3,4))</span></pre>
<p> निम्नलिखित कोड का आउटपुट :</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def add(a,b):<br></span><span style="font-size: 14px;"> return(a+b)<br></span><span style="font-size: 14px;">print(add(3,4))</span></pre>
A.
4
4
B.
7
7
C.
9
9
D.
8
8
Question No# :
19
out of 50
The *args parameter stores arguments as:
*args पैरामीटर आर्गुमेंट्स को इस प्रकार स्टोर करता है:
A.
List
List
B.
Tuple
Tuple
C.
Dictionary
Dictionary
D.
Set
Set
Question No# :
20
out of 50
<p>What will be the output of the following Python function?</p><pre><span style="font-size: 14px;">len(["hello",2, 4, 6])</span></pre>
<p>निम्नलिखित Python फ़ंक्शन का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">len(["hello",2, 4, 6])</span></pre>
A.
4
4
B.
3
3
C.
Error
एरर
D.
6
6
Question No# :
21
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">def f1(a,b=[]):<br></span><span style="font-size: 14px;"> b.append(a)<br></span><span style="font-size: 14px;"> return b<br></span><span style="font-size: 14px;">print(f1(2,[3,4]))</span></pre><div><br></div>
<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def f1(a,b=[]):<br></span><span style="font-size: 14px;"> b.append(a)<br></span><span style="font-size: 14px;"> return b<br></span><span style="font-size: 14px;">print(f1(2,[3,4]))</span></pre>
A.
[3,2,4]
[3,2,4]
B.
[2,3,4]
[2,3,4]
C.
Error
एरर
D.
[3,4,2]
[3,4,2]
Question No# :
22
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 12.6px;">example = "helle" print(example.rfind("e"))</span><br></pre>
<p>निम्नलिखित पायथन कोड का आउटपुट क्या होगा?</p><pre style=""><span style="font-size: 12.6px;">example = "helle" print(example.rfind("e"))</span><span style="font-size: 12.6px; letter-spacing: 0.14px;"><br></span></pre>
A.
1
1
B.
2
2
C.
4
4
D.
5
5
Question No# :
23
out of 50
what is Lambda function in python
पायथन में लैम्ब्डा फंक्शन क्या है ?
A.
A built-in Python function
एक अंतर्निहित पायथन फ़ंक्शन
B.
A one-line anonymous function
एक-पंक्ति वाला अनाम फ़ंक्शन
C.
Lambda is a function in python but user can not use it.
लैम्ब्डा पायथन में एक फंक्शन है लेकिन उपयोगकर्ता इसका उपयोग नहीं कर सकता।
D.
None of the above
उपर्युक्त में से कोई नहीं
Question No# :
24
out of 50
Which of the following is a distinct syntactic block?
निम्नलिखित में से कौन सा एक विशिष्ट वाक्यात्मक ब्लॉक है?
A.
Subroutines
Subroutines
B.
Function
Function
C.
Definition
Definition
D.
Modules
Modules
Question No# :
25
out of 50
What is the scope of a function parameter?
फंक्शन पैरामीटर का स्कोप क्या है?
A.
Global Scope
Global Scope
B.
Built-in Scope
Built-in Scope
C.
Local Scope
Local Scope
D.
Module Scope
Module Scope
Question No# :
26
out of 50
<p>What is the return type of following function ?</p><pre>def func1():<br> return 'mnp',22<br>print(type(func1()))</pre>
<p>निम्नलिखित फंक्शन का रिटर्न प्रकार क्या है?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">def func1():<br> return 'mnp',22<br>print(type(func1()))</pre>
A.
List
List
B.
Dictionary
Dictionary
C.
String
String
D.
Tuple
Tuple
Question No# :
27
out of 50
What is the correct syntax of a lambda function?
लैम्डा फंक्शन का सही सिंटैक्स क्या है?
A.
lambda x => x+1
lambda x => x+1
B.
lambda(x): x+1
lambda(x): x+1
C.
lambda x: x+1
lambda x: x+1
D.
def lambda(x): x+1
def lambda(x): x+1
Question No# :
28
out of 50
Which of the following data structures is returned by the functions globals() and locals()?
निम्नलिखित में से कौन सा डेटा स्ट्रक्चर फंक्शन ग्लोबल्स () और लोकल लोगों () द्वारा रिटर्न की जाती है?
A.
list
लिस्ट
B.
set
सेट
C.
dictionary
डिक्शनरी
D.
tuple
टपल
Question No# :
29
out of 50
Which of the following modules need to be imported to handle date time computations in Python?
दिनांक समय गणनाओं को संभालने के लिए निम्नलिखित में से किस मॉड्यूल को आयात करने की आवश्यकता है? अजगर?
A.
datetime
datetime
B.
date
date
C.
time
time
D.
timedate
timedate
Question No# :
30
out of 50
What happens if the base condition isn’t defined in recursive programs?
यदि रिकर्सिव फ़ंक्शन में बेस की कंडीशन को डिफाइन नहीं किया जाता है तो क्या होता है?
A.
Program gets into an infinite loop
प्रोग्राम एक इन्फनिट लूप में जाता है
B.
Program runs once
प्रोग्राम एक बार चलता है
C.
Program runs n number of times where n is the argument given to the function
प्रोग्राम n की नंबर को चलाता है जहां n फ़ंक्शन के लिए दिया गया आर्ग्यमन्ट है
D.
An exception is thrown
एक एक्सेप्शन फेंक दिया जाता है
Question No# :
31
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">print("xyyzxyzxzxyy".count('yy'))</span></pre>
<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">print("xyyzxyzxzxyy".count('yy'))</span></pre>
A.
2
2
B.
0
0
C.
error
एरर
D.
none of the mentioned
उल्लेखित कोई नहीं
Question No# :
32
out of 50
Suppose there is a list such that: l=[2,3,4]. If we want to print this list in reverse order, which of the following methods should be used?
मान लीजिए कि एक लिस्ट ऐसी है: l = [2,3,4]। यदि हम इस लिस्ट को रिवर्स ऑर्डर में प्रिंट करना चाहते हैं, तो निम्न में से किस मैथड का यूज़ किया जाना चाहिए?
A.
reverse(l)
reverse(l)
B.
list(reverse[(l)])
list(reverse[(l)])
C.
reversed(l)
reversed(l)
D.
list(reversed(l))
list(reversed(l))
Question No# :
33
out of 50
<p>What will be the output of the following Python function?</p><pre><span style="font-size: 14px;">min(max(False,-3,-4), 2,7)</span></pre>
<p>निम्नलिखित Python फ़ंक्शन का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">min(max(False,-3,-4), 2,7)</span></pre>
A.
2
2
B.
False
गलत
C.
-3
-3
D.
-4
-4
Question No# :
34
out of 50
How many keyword arguments can be passed to a function in a single function call?
एक फ़ंक्शन कॉल में किसी फ़ंक्शन को कितने कीवर्ड आर्ग्यमन्ट दिए जा सकते हैं?
A.
zero
ज़ीरो
B.
one
एक
C.
zero or more
ज़ीरो या अधिक
D.
one or more
एक या अधिक
Question No# :
35
out of 50
What will be displayed by print(ord(‘b’) – ord(‘a’))?
print(ord (‘b') - ord ('a’)) क्या डिस्प्ले करेगा?
A.
0
0
B.
1
1
C.
-1
-1
D.
2
2
Question No# :
36
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">x='abcd'<br></span><span style="font-size: 14px;">for i in x:<br></span><span style="font-size: 14px;"> print(i.upper())</span></pre><div><br></div><p><br></p>
<p>निम्नलिखित पायथन कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">x='abcd'<br></span><span style="font-size: 14px;">for i in x:<br></span><span style="font-size: 14px;"> print(i.upper())</span></pre>
A.
a BCD
a BCD
B.
abcd
abcd
C.
error
error
D.
A B CD
A B CD
Question No# :
37
out of 50
<p>What is the output of the following code ?</p><pre>def fun(a, b=6):<br> a=a+b<br> print(a)<br>fun(5, 4)</pre><div><br></div>
<p>निम्नलिखित कोड का परिणाम क्या है ?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">def fun(a, b=6):<br> a=a+b<br> print(a)<br>fun(5, 4)</pre>
A.
11
11
B.
9
9
C.
5
5
D.
4
4
Question No# :
38
out of 50
How are default arguments specified in the function heading?
फ़ंक्शन के हैडिंग में डिफ़ॉल्ट आर्ग्यमन्ट कैसे स्पेसिफ़ाइड किए जाते हैं?
A.
identifier followed by an equal to sign and the default value
आइडेंटिफाइड साइन और डिफ़ॉल्ट वैल्यू के बराबर होता है
B.
identifier followed by the default value within backticks (“)
आइडेंटीफायर के पीछे डिफ़ॉल्ट वैल्यू के बाद (")
C.
identifier followed by the default value within square brackets ([])
स्क्वायर ब्रैकेट्स ([]) के भीतर डिफ़ॉल्ट वैल्यू के बाद आइडेंटीफायर
D.
identifier
आइडेंटीफायर
Question No# :
39
out of 50
Which of the following is an anonymous function in Python?
निम्नलिखित में से कौन सा पाइथन में एक अनाम फ़ंक्शन है?
A.
Recursive Function
Recursive Function
B.
Lambda Function
Lambda Function
C.
Built-in Function
Built-in Function
D.
Generator Function
Generator Function
Question No# :
40
out of 50
Which argument type allows specifying parameter names during function call?
किस प्रकार के तर्क से फंक्शन कॉल के दौरान पैरामीटर नाम निर्दिष्ट किए जा सकते हैं?
A.
Positional
Positional
B.
Keyword
Keyword
C.
Default
Default
D.
Variable
Variable
Question No# :
41
out of 50
<p>What is the output of the following</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">y='klmn'<br>for i in range(len(y)):<br> print(y)</pre>
<p>निम्नलिखित कोड का आउटपुट क्या होगा?</p><pre>y='klmn'<br>for i in range(len(y)):<br> print(y)</pre><div><br></div>
A.
klmn klmn klmn klmn
klmn klmn klmn klmn
B.
k
k
C.
kkk
kkk
D.
None of the these
इनमे से कोई नहीं
Question No# :
42
out of 50
The variables in a function definition are called as
फ़ंक्शन परिभाषा में वेरिएबल्स को कहा जाता है
A.
Subroutines
Subroutines
B.
Function
Function
C.
Definition
Definition
D.
Parameters
Parameters
Question No# :
43
out of 50
Which of the following is NOT a valid type of argument in Python?
निम्नलिखित में से कौन सा पाइथन में मान्य तर्क प्रकार नहीं है?
A.
Required Argument
Required Argument
B.
Keyword Argument
Keyword Argument
C.
Default Argument
Default Argument
D.
Decimal Argument
Decimal Argument
Question No# :
44
out of 50
Which of these is not true about recursion?
इनमें से कौन सा रिकर्शन के बारे में सच नहीं है?
A.
Making the code look clean
कोड को साफ देखो
B.
A complex task can be broken into sub-problems
एक कॉम्प्लेक्स टास्क को सब-प्रॉब्लम्स में तोड़ा जा सकता है
C.
Recursive calls take up less memory
रिकर्सिव कॉल से मेमोरी कम लगती है
D.
Sequence generation is easier than a nested iteration
सीक्वेंस जनरेशन एक नेस्टेड पुनरावृत्ति की तुलना में आसान है
Question No# :
45
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">print("ccdcddcd".find("c"))</span></pre>
<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">print("ccdcddcd".find("c"))</span></pre>
A.
4
4
B.
0
0
C.
Error
एरर
D.
True
सही
Question No# :
46
out of 50
____ keyword used for function in python
पायथन में फ़ंक्शन के लिए कौन सा कीवर्ड उपयोग किया जाता है
A.
fun
fun
B.
function
function
C.
def
def
D.
define
define
Question No# :
47
out of 50
Function defined to achieve some task as per the programmers requirement is called a :
प्रोग्रामर की आवश्यकता के अनुसार किसी कार्य को प्राप्त करने के लिए परिभाषित फंक्शन कहलाता है
A.
User Defined Function
User Defined Function
B.
Library Functions
Library Functions
C.
Builtin Functions
Builtin Functions
D.
All of the above
All of the above
Question No# :
48
out of 50
Which one of the following is the correct way of calling a function?
निम्नलिखित में से कौन-सा एक फंक्शन को कॉल करने का सही तरीका है?
A.
function_name()
function_name()
B.
call function_name()
call function_name()
C.
ret function_name()
ret function_name()
D.
function function_name()
function function_name()
Question No# :
49
out of 50
<p>What will be the output of the following Python code?</p><pre>from math import factorial<br>print(math.factorial(5))</pre><div><br></div>
<p>निम्नलिखित पायथन कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">from math import factorial<br>print(math.factorial(5))</pre>
A.
120
120
B.
Nothing is printed
कुछ भी प्रिंट नहीं होगा
C.
NameError: name 'math' is not defined
एरर मेथड फुक्टोरिअल मैथ मॉडयूल एकसिस्ट नहीं करता
D.
Error, the statement should be print factorial(5))
एरर स्टेटमेंट होनी चाहिए print(factorial(5 ))
Question No# :
50
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">def foo(x):<br></span><span style="font-size: 14px;"> x = ['def', 'abc']<br></span><span style="font-size: 14px;"> return id(x)<br></span><span style="font-size: 14px;">q = ['abc', 'def']<br></span><span style="font-size: 14px;">print(id(q) == foo(q))</span></pre>
<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def foo(x):<br></span><span style="font-size: 14px;"> x = ['def', 'abc']<br></span><span style="font-size: 14px;"> return id(x)<br></span><span style="font-size: 14px;">q = ['abc', 'def']<br></span><span style="font-size: 14px;">print(id(q) == foo(q))</span></pre>
A.
True
सही
B.
False
गलत
C.
None
None
D.
Error
एरर
Online Exam Quiz for One day Exam
Online Typing Test
CCC Online Test 2026
Best Computer Training Institute in Prayagraj (Allahabad)
Best Java Training Institute in Prayagraj (Allahabad)
Best Python Training Institute in Prayagraj (Allahabad)
O Level Online Test in Hindi
Best Website and Software Company in Allahabad