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
<p>What is the output of below program ?</p><pre>def say(message, times =1):<br> print(message * times)<br>say("Hello")<br>say("Word",5)</pre>
<p>नीचे दिए गए प्रोग्राम का आउटपुट क्या है?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">def say(message, times =1):<br> print(message * times)<br>say("Hello")<br>say("Word",5)</pre>
A.
Hello WordWordWordWordWord
Hello WordWordWordWordWord
B.
Hello Word 5
Hello Word 5
C.
Hello Word,Word,Word,Word,Word
Hello Word,Word,Word,Word,Word
D.
Hello HelloHelloHelloHelloHello
Hello HelloHelloHelloHelloHello
Question No# :
02
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# :
03
out of 50
Which is the most appropriate definition for recursion?
पुनरावृत्ति के लिए सबसे उपयुक्त परिभाषा कौन सी है?
A.
A function that calls itself
एक फ़ंक्शन जो स्वयं को कॉल करता है
B.
A function execution instance that calls another execution instance of the same function
एक फ़ंक्शन एक्सेक्यूशन इंस्टैंस जो उसी फ़ंक्शन के किसी अन्य एक्सेक्यूशन इंस्टैंस को कॉल करता है
C.
A class method that calls another class method
एक क्लास मैथड जो दूसरे क्लास मैथड को बुलाती है
D.
An in-built method that is automatically called
एक अंतर्निहित पद्धति जिसे स्वचालित रूप से कहा जाता है
Question No# :
04
out of 50
<p>What will be the output of the following python code?</p><pre>def printMax(a,b):<br> if a>b:<br> print(a, "is maximum")<br> elif a==b:<br> print(a, "is equal to ",b)<br> else:<br> print(b, "is maximum")<br>printMax(3,4)</pre>
<p>निम्नलिखित पायथन कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">def printMax(a,b):<br> if a>b:<br> print(a, "is maximum")<br> elif a==b:<br> print(a, "is equal to ",b)<br> else:<br> print(b, "is maximum")<br>printMax(3,4)</pre>
A.
3
3
B.
4
4
C.
4 is maximum
4 is maximum
D.
None of these
None of these
Question No# :
05
out of 50
<p>What will be the output of the following Python function?</p> <pre><span class="kw2" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" green;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">sum</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">(</span><span class="nu0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">2</span><span class="sy0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">4</span><span class="sy0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">6</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">)<br></span><span class="kw2" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" green;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">sum</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">(</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">[</span><span class="nu0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">1</span><span class="sy0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">2</span><span class="sy0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">3</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">]</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">)</span></pre>
<p>निम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span class="kw2" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" green;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">sum</span><span class="br0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">(</span><span class="nu0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">2</span><span class="sy0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">4</span><span class="sy0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">6</span><span class="br0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">)<br></span><span class="kw2" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" green;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">sum</span><span class="br0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">(</span><span class="br0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">[</span><span class="nu0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">1</span><span class="sy0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">2</span><span class="sy0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(102,="" 204,="" 102);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">,</span><span class="nu0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">3</span><span class="br0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">]</span><span class="br0" lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">)</span></pre>
A.
Error, 6
एरर,6
B.
12, Error
12,एरर
C.
12, 6
12, 6
D.
Error, Error
एरर,एरर
Question No# :
06
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# :
07
out of 50
How are keyword arguments specified in the function heading?
फ़ंक्शन हेडिंग में कीवर्ड आर्ग्यमन्ट कैसे स्पेसिफ़ाइड किए जाते हैं?
A.
one-star followed by a valid identifier
एक के बाद एक वैलिड आइडेंटिफायर
B.
one underscore followed by a valid identifier
एक वैलिड आइडेंटिफायर के बाद एक अंडरस्कोर
C.
two stars followed by a valid identifier
दो स्टार्स के बाद एक वैलिड आइडेंटिफायर है
D.
two underscores followed by a valid identifier
वैलिड आइडेंटिफायर द्वारा दो अंडरस्कोर
Question No# :
08
out of 50
Given a string x="hello" What is the output of x.count('l')?
एक स्ट्रिंग x = "hello " को देखते हुए x.count ('1') का आउटपुट क्या है?
A.
2
2
B.
1
1
C.
0
0
D.
none
कोई नहीं
Question No# :
09
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# :
10
out of 50
<p>What will be the output of the following Code?</p><pre><span style="font-size: 14px;">def sum(x):<br></span><span style="font-size: 14px; white-space: normal;"><span style="white-space:pre"> </span>return x*x<br></span><span style="font-size: 14px;">print(sum(4))</span></pre>
<p>निम्नलिखित कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def sum(x):<br></span><span style="font-size: 14px; white-space: normal;"><span style="white-space: pre;"> </span>return x*x<br></span><span style="font-size: 14px;">print(sum(4))</span></pre>
A.
16
16
B.
4
4
C.
8
8
D.
64
64
Question No# :
11
out of 50
<p>Choose the correct function declaration of fun1() so that we can execute the following two function calls successfully.</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;">fun1(25, 75, 55)<br>fun1(10, 20)</pre>
<p style="font-size: 12.6px; letter-spacing: 0.14px;">fun1() का सही फंक्शन डिक्लेरेशन चुनें ताकि हम निम्नलिखित दो फंक्शन कॉल्स को सफलतापूर्वक निष्पादित कर सकें।</p><pre>fun1(25, 75, 55)<br>fun1(10, 20)</pre>
A.
def fun1(**kwargs)
def fun1(**kwargs)
B.
def fun1(args*)
def fun1(args*)
C.
No, it is not possible in Python
No, it is not possible in Python
D.
def fun1(*data)
def fun1(*data)
Question No# :
12
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# :
13
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# :
14
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# :
15
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# :
16
out of 50
<p>What will be the output of the following Python code ?</p><pre><span style="font-size: 14px;">def display(b,n):<br></span><span style="font-size: 14px;"> while n>0:<br></span><span style="font-size: 14px;"> print(b,end='')<br></span><span style="font-size: 14px;"> n=n-1<br></span><span style="font-size: 14px;">display('z',3)</span></pre>
<p>निम्नलिखित पायथन कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def display(b,n):<br></span><span style="font-size: 14px;"> while n>0:<br></span><span style="font-size: 14px;"> print(b,end='')<br></span><span style="font-size: 14px;"> n=n-1<br></span><span style="font-size: 14px;">display('z',3)</span></pre>
A.
zzz
zzz
B.
zz
zz
C.
Infinite loop
Infinite loop
D.
An exception is thrown
An exception is thrown
Question No# :
17
out of 50
Which of the following statements is false about recursion?
निम्नलिखित में से कौन सा स्टेट्मेंट रिकर्शन के बारे में गलत है?
A.
Every recursive function must have a base case
प्रत्येक रिकर्सिव फ़ंक्शन का बेस केस होना चाहिए
B.
Infinite recursion can occur if the base case isn’t properly mentioned
यदि बेस केस का प्रॉपर्ली मेंशन्ड नहीं किया गया है तो इनफिनिट रिकर्शन हो सकती है
C.
A recursive function makes the code easier to understand
एक रिकर्सिव फ़ंक्शन कोड को समझने में आसान बनाता है
D.
Every recursive function must have a return value
प्रत्येक रिकर्सिव फ़ंक्शन का रिटर्न वैल्यू होना चाहिए
Question No# :
18
out of 50
Which module in the python standard library parses options received from the command line?
पायथन स्टैंडर्ड लाइब्रेरी में कौन सा मॉड्यूल कमांड लाइन से प्राप्त ऑप्शन है?
A.
getopt
getopt
B.
os
os
C.
getarg
getarg
D.
main
main
Question No# :
19
out of 50
How are variable length arguments specified in the function heading?
फ़ंक्शन हेडिंग में वैरिएबल लेंथ आर्ग्यमन्ट कैसे स्पेसिफ़ाइड किए जाते हैं?
A.
one star followed by a valid identifier
एक स्टार के बाद एक वैलिड आइडेंटीफायर है
B.
one underscore followed by a valid identifier
एक वैलिड आइडेंटीफायर के बाद एक अंडरस्कोर
C.
two stars followed by a valid identifier
दो स्टार्स के बाद एक वैलिड आइडेंटीफायर है
D.
two underscores followed by a valid identifier
वैलिड आइडेंटीफायर द्वारा दो अंडरस्कोर
Question No# :
20
out of 50
<p>What will be the output of the following Python code?</p><pre><span style="font-size: 14px;">def foo(k): <br></span><span style="font-size: 14px; white-space: normal;"><span style="white-space:pre"> </span>k[0] = 1 <br></span><span style="font-size: 14px;">q = [0] <br></span><span style="font-size: 14px;">foo(q) <br></span><span style="font-size: 14px;">print(q)</span></pre>
<p>निम्नलिखित Python कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def foo(k): <br></span><span style="font-size: 14px; white-space: normal;"><span style="white-space: pre;"> </span>k[0] = 1 <br></span><span style="font-size: 14px;">q = [0] <br></span><span style="font-size: 14px;">foo(q) <br></span><span style="font-size: 14px;">print(q)</span></pre>
A.
[0]
[0]
B.
[1]
[1]
C.
[1, 0]
[1, 0]
D.
[0, 1]
[0, 1]
Question No# :
21
out of 50
Which of the following functions is a built-in function in pythonn
निम्न में से कौन सा फंक्शन पायथन में बिल्ट-इन फंक्शन है
A.
factorial()
factorial()
B.
print()
print()
C.
seed()
seed()
D.
sqrt()
sqrt()
Question No# :
22
out of 50
What is tail recursion?
टेल रिकर्शन क्या है?
A.
A recursive function that has two base cases
एक रिकर्सिव फ़ंक्शन जिसमें दो बेस केसेस हैं
B.
A function where the recursive functions leads to an infinite loop
एक फ़ंक्शन जहां रिकर्सिव फ़ंक्शन एक इनफिनिट लूप की ओर जाता है
C.
A recursive function where the function doesn’t return anything and just prints the values
एक रिकर्सिव फ़ंक्शन जहां फ़ंक्शन कुछ भी वापस नहीं करता है और केवल वैल्यूज को प्रिंट करता है
D.
A function where the recursive call is the last thing executed by the function
एक फ़ंक्शन जहां रिकर्सिव कॉल फ़ंक्शन द्वारा एक्सेक्यूटेड लास्ट चीज़ है
Question No# :
23
out of 50
What does a function return if there is no return statement?
यदि किसी फंक्शन में रिटर्न स्टेटमेंट नहीं है, तो वह फंक्शन क्या रिटर्न करेगा?
A.
0
0
B.
False
False
C.
None
None
D.
Error
Error
Question No# :
24
out of 50
Which of the following functions converts date to corresponding time in Python?
निम्नलिखित में से कौन सा फ़ंक्शन पायथन में दिनांक को संगत समय में परिवर्तित करता है?
A.
strptime()
strptime()
B.
strftime()
strftime()
C.
Both A and B
Both A and B
D.
None of the above
None of the above
Question No# :
25
out of 50
Which of the following function headers is correct ?
निम्नलिखित में से कौन सा फंक्शन हेडर सही है?
A.
def fun (a = 2, b = 3, c)
def fun (a = 2, b = 3, c)
B.
def fun(a = 2, b, c = 3)
def fun(a = 2, b, c = 3)
C.
def fun(a, b = 2, c = 3)
def fun(a, b = 2, c = 3)
D.
def fun(a, b, c = 3, d)
def fun(a, b, c = 3, d)
Question No# :
26
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# :
27
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# :
28
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# :
29
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# :
30
out of 50
What is a variable defined outside a function referred to as ?
किसी फ़ंक्शन के बाहर परिभाषित वेरिएबल को क्या कहते है?
A.
A static variable
एक स्थिर वेरिएबल
B.
A global variable
एक वैश्विक वेरिएबल
C.
A local variable
एक स्थानीय वेरिएबल
D.
An automatic variable
एक स्वचालित वेरिएबल
Question No# :
31
out of 50
Where is function defined?
फंक्शन को कहां डिफाइन किया जाता है?
A.
In Module
मॉड्यूल
B.
In Class
क्लास
C.
In Another function
एक और फंक्शन
D.
All of these
उपर्युक्त सभीं
Question No# :
32
out of 50
<p>What is the output of the following code ?</p><pre><span style="font-size: 14px;">def disp(*arg):<br></span><span style="font-size: 14px;"> for i in arg:<br></span><span style="font-size: 14px;"> print(i)<br></span><span style="font-size: 14px;">disp(name="Rajat", age="20")</span></pre>
<p>निम्नलिखित कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">def disp(*arg):<br></span><span style="font-size: 14px;"> for i in arg:<br></span><span style="font-size: 14px;"> print(i)<br></span><span style="font-size: 14px;">disp(name="Rajat", age="20")</span></pre>
A.
TypeError
TypeError
B.
Rajat 20
Rajat 20
C.
Name age
Name age
D.
None of these
None of these
Question No# :
33
out of 50
____ are the arguments passed to a function in correct positional order.
सही स्थिति क्रम में किसी फंक्शन को दिए गए आर्गुमेन्ट हैं।
A.
Required arguments
आवश्यक आर्गुमेन्ट
B.
Keyword arguments
कीवर्ड आर्गुमेन्ट
C.
Default arguments
डिफॉल्ट आर्गुमेन्ट
D.
Variable-length arguments
वेरियेबिल लेंग्थ आर्गुमेन्ट्स
Question No# :
34
out of 50
<p>What is the output of the following code?</p><pre><span style="font-size: 14px;">x = 50<br></span><span style="font-size: 14px;">def func (x):<br></span><span style="font-size: 14px;"> x = 2<br></span><span style="font-size: 14px;">func (x)<br></span><span style="font-size: 14px;">print ('x is now', x)</span></pre>
<p>निम्नलिखित कोड का आउटपुट क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">x = 50<br></span><span style="font-size: 14px;">def func (x):<br></span><span style="font-size: 14px;"> x = 2<br></span><span style="font-size: 14px;">func (x)<br></span><span style="font-size: 14px;">print ('x is now', x)</span></pre>
A.
x is now 50
x is now 50
B.
x is now 2
x is now 2
C.
x is now 100
x is now 100
D.
Error
Error
Question No# :
35
out of 50
Which of these is false about recursion?
इनमें से कौन सी पुनरावृत्ति के बारे में गलत है?
A.
Recursive function can be replaced by a non-recursive function
रिकर्सिव फ़ंक्शन को नॉन-रिकर्सिव फ़ंक्शन द्वारा रेप्लस किया जा सकता है
B.
Recursive functions usually take more memory space than non-recursive function
रिकर्सिव फ़ंक्शन आमतौर पर नॉन-रिकर्सिव फ़ंक्शन की तुलना में अधिक मेमोरी स्पेस लेते हैं
C.
Recursive functions run faster than non-recursive function
रिकर्सिव फ़ंक्शन नॉन-रिकर्सिव फ़ंक्शन की तुलना में तेज़ी से चलते हैं
D.
Recursion makes programs easier to understand
रिकर्सियन प्रोग्राम्स को समझने में आसान बनाता है
Question No# :
36
out of 50
What is the length of sys.argv?
Sys.argv की लेंथ क्या है?
A.
number of arguments
number of arguments
B.
number of arguments + 1
number of arguments + 1
C.
number of arguments – 1
number of arguments – 1
D.
none of the mentioned
उल्लेखित कोई नहीं
Question No# :
37
out of 50
<p>What will be the output?</p><pre><span style="font-size: 14px;">x = 10</span><span style="font-size: 14px;"><br></span><span style="font-size: 14px;">def fun():<br></span><span style="font-size: 14px;"> global x<br></span><span style="font-size: 14px;"> x = 20</span><span style="font-size: 14px;"><br></span><span style="font-size: 14px;">fun()<br></span><span style="font-size: 14px;">print(x)</span></pre>
<p>इसका परिणाम क्या होगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">x = 10</span><span style="font-size: 14px;"><br></span><span style="font-size: 14px;">def fun():<br></span><span style="font-size: 14px;"> global x<br></span><span style="font-size: 14px;"> x = 20</span><span style="font-size: 14px;"><br></span><span style="font-size: 14px;">fun()<br></span><span style="font-size: 14px;">print(x)</span></pre>
A.
10
10
B.
20
20
C.
Error
Error
D.
None
None
Question No# :
38
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# :
39
out of 50
What happens if a local variable exists with the same name as the global variable you want to access?
यदि कोई लोकल वैरिएबल वैसा ही नाम के साथ मौजूद है जैसा कि ग्लोबल वैरिएबल जिसे आप एक्सेस करना चाहते हैं?
A.
Error
एरर
B.
The local variable is shadowed
लोकल वैरिएबल छाया हुआ है
C.
Undefined behavior
अनडिफाइन बिहेवियर
D.
The global variable is shadowed
ग्लोबल वैरिएबल छाया हुआ है
Question No# :
40
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[0] = ['def']<br></span><span style="font-size: 14px;"> x[1] = ['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[0] = ['def']<br></span><span style="font-size: 14px;"> x[1] = ['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
कोई नहीं
D.
Error
एरर
Question No# :
41
out of 50
Which type of function calls itself directly or indirectly?
किस प्रकार का फंक्शन स्वयं को प्रत्यक्ष या अप्रत्यक्ष रूप से कॉल करता है?
A.
Lambda Function
Lambda Function
B.
Recursive Function
Recursive Function
C.
Anonymous Function
Anonymous Function
D.
Built-in Function
Built-in Function
Question No# :
42
out of 50
The function divmod(a,b), where both ‘a’ and ‘b’ are integers is evaluated as:
फ़ंक्शन डिमोड (ए, बी), जहां दोनों 'ए' और 'बी' इन्टिजर हैं, का इवैल्यूऐटनिम्नानुसार किया जाता है:
A.
(a%b, a//b)
(a%b, a//b)
B.
(a//b, a%b)
(a//b, a%b)
C.
(a//b, a*b)
(a//b, a*b)
D.
(a/b, a%b)
(a/b, a%b)
Question No# :
43
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# :
44
out of 50
What is recursion in python?
पाइथन में रिकर्शन फंक्शन के है
A.
Repeating a process in a loop
Repeating a process in a loop
B.
Calling a function from within itself
Calling a function from within itself
C.
Using a loop to iterate over elements
Using a loop to iterate over elements
D.
Breaking down a problem into smaller subproblems
Breaking down a problem into smaller subproblems
Question No# :
45
out of 50
Which of the following functions accepts only integers as arguments?
निम्नलिखित में से कौन सा फंक्शन केवल इन्टिजर को आर्ग्यमन्ट के रूप में एक्सेप्ट करता है?
A.
ord()
ord()
B.
min()
min()
C.
chr()
chr()
D.
any()
any()
Question No# :
46
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# :
47
out of 50
Which part of the memory does the system store the parameter and local variables of a function call ?
मेमोरी का कौन सा भाग सिस्टम फ़ंक्शन कॉल के पैरामीटर और स्थानीय चर को संग्रहीत करता है?
A.
Heap
Heap
B.
Stack
Stack
C.
Uninitialized data segment
Uninitialized data segment
D.
None of the above
None of the above
Question No# :
48
out of 50
Debugging is the process of fixing a______in the software.
डिबगिंग सॉफ्टवेयर में ______ को ठीक करने की प्रक्रिया है।
A.
procedure
प्रकिया
B.
function
कार्य
C.
bug
बग
D.
None of these
इनमे से कोई नहीं
Question No# :
49
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# :
50
out of 50
The small sections of code that are used to perform a particular task is called
The small sections of code that are used to perform a particular task is called
A.
Subroutines
Subroutines
B.
Files
Files
C.
Pseudo code
Pseudo code
D.
Modules
Modules
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