Q1.
निम्नलिखित पायथन प्रोग्राम का आउटपुट ज्ञात करें।
Find the output of following Python Programs.def gfg(x, 1=[]):
for i in range(x):
1.append(i*i)
print(1)
gfg(2)
A.
[3, 2, 1, 0, 1, 4]
B.
[0, 1]
C.
[0, 1, 0, 1, 4]
D.
Error in Code
View Answer
Correct Answer: Error in Code
Q2.
मान लीजिए t = (1, 2, 4, 3), निम्नलिखित में से कौन सा गलत है?
Suppose t = (1, 2, 4, 3), which of the following is incorrect?
A.
print(t[3])
B.
t[3] = 45
C.
print(max(t))
D.
print(len(t))
View Answer
Correct Answer: t[3] = 45
Q3.
रिकर्सन के बारे में निम्नलिखित में से कौन सा कथन असत्य है?
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 is not properly mentioned
C.
एक रिकर्सिव फ़ंक्शन कोड को समझने में आसान बनाता है/A recursive function makes the code easier to understand
D.
प्रत्येक रिकर्सिव फ़ंक्शन में वापसी मान होना चाहिए/Every recursive function must have a return value
View Answer
Correct Answer: प्रत्येक रिकर्सिव फ़ंक्शन में वापसी मान होना चाहिए/Every recursive function must have a return value
Q4.
फ़ंक्शन ब्लॉक ………. कीवर्ड से शुरू होते हैं।
Functions blocks begin with the keyword.
A.
del
B.
def
C.
define
D.
function
View Answer
Correct Answer: def
Q5.
निम्नलिखित पायथन प्रोग्राम्स का आउटपुट है …………
The output of following Python Programs is…………r = lambda q:q*2
s = lambda q:q*3
x = 2
x = r(x)
x = s(x)
x = r(x)
print(x)
A.
24
B.
48
C.
64
D.
Error in Code
View Answer
Correct Answer: 24
Q6.
रिकर्सिव फंक्शन आमतौर पर नॉन-रिकर्सिव फंक्शन की तुलना में ………… मेमोरी स्पेस लेते हैं।
Recursive functions usually take ………… memory space than non-recursive function.
A.
more
B.
less
C.
can’t say
D.
None of these
View Answer
Correct Answer: more
Q7.
Python भाषा में सभी Parameters (arguments) ……………… द्वारा पारित किए जाते हैं।
All parameters (arguments) in the Python language are passed by………………
A.
objects
B.
parenthesis
C.
reference
D.
None of these
View Answer
Correct Answer: reference
Q8.
…………… को केवल उस फंक्शन के अंदर एक्सेस किया जा सकता है जिसमें वे घोषित किए गए हैं, जबकि ग्लोबल वेरिएबल्स को सभी फंक्शन्स द्वारा पूरे प्रोग्राम बॉडी में एक्सेस किया जा सकता है।
The …………… can be accessed only inside the function in which they are declared, whereas global variables can be accessed throughout the program body by all functions.
A.
global variables
B.
local variables
C.
can’t say
D.
None
View Answer
Correct Answer: local variables
Q9.
पायथन के इन-बिल्ट फंक्शन का उपयोग एक स्ट्रिंग से सभी प्रमुख और अनुगामी रिक्त स्थान को हटाने के लिए किया जाता है
in-built function of Python is used to remove all the leading and trailing spaces from a string.
A.
lsstrip()
B.
trail()
C.
strip()
D.
None of these
View Answer
Correct Answer: strip()
Q10.
यदि स्ट्रिंग में सभी वर्ण अल्फ़ान्यूमेरिक (या तो अक्षर या संख्या) हैं, तो विधि true रिटर्न करता है यदि नहीं, तो यह false लौटाता है।
This method returns true if all characters in the string are alphanumeric (either alphabets or numbers). If not, it returns false.
A.
isalphanum()
B.
isalnum()
C.
isalphanumeric()
D.
None
View Answer
Correct Answer: isalnum()
Q11.
__________ मेथड बिल्ट-इन पायथन हेल्प सिस्टम को कॉल करता है।
__________ method calls the built-in Python help system.
A.
helpview()
B.
help()
C.
helpme()
D.
None of these
View Answer
Correct Answer: help()
Q12.
__________ विधि सभी अपरकेस वर्णों को दिए गए स्ट्रिंग के लोअरकेस और इसके विपरीत में परिवर्तित करती है, और इसे वापस करती है।
__________ method converts all uppercase characters to lowercase and vice versa of the given string, and returns it.
A.
uppertolower
B.
isUpper
C.
toUpper
D.
swapcase
View Answer
Correct Answer: swapcase
Q13.
निम्नलिखित प्रोग्राम का आउटपुट क्या है?
What is the output of the following program?def myfunc(a):
a=a+2
a=a*2
return a
print(myfunc(2))
A.
8
B.
16
C.
Indentation Error
D.
Runtime Error
View Answer
Correct Answer: 8
Q14.
एक फ़ंक्शन दिया गया है जो कोई मान नहीं लौटाता है, शेल पर निष्पादित होने पर कौन सा मान दिखाया जाता है?
Given a function that does not return any value, what value is shown when executed at the shell?
A.
int
B.
bool
C.
void
D.
None
View Answer
Correct Answer: None
Q15.
एक स्ट्रिंग s="Welcome" दिया गया है, निम्न में से कौन सा कोड गलत है?
Given a string s="Welcome", which of the following code is incorrect?
A.
print s[0]
B.
print s.lower()
C.
s[1]='r'
D.
print s.strip()
View Answer
Correct Answer: print s[0]
Q16.
किसी फ़ंक्शन के लिए कोई डिफ़ॉल्ट रिटर्न मान नहीं है जो किसी भी मान को स्पष्ट रूप से वापस नहीं करता है।
There is no default return value for a function that does not return any value explicitly.
A.
True
B.
False
C.
can’t say
D.
None of these
View Answer
Correct Answer: False
Q17.
फ़ंक्शन का नाम और पैरामीटर लिस्ट फ़ंक्शन हेडर का हिस्सा हैं।
Function name and parameter list are part of function header.
A.
True
B.
False
C.
can’t say
D.
None of these
View Answer
Correct Answer: True
Q18.
ब्रैकेट इनपुट पैरामीटर या फ़ंक्शन के तर्कों को संलग्न करते हैं।
Brackets enclose the input parameters or arguments of a function.
A.
True
B.
False
C.
can’t say
D.
None of these
View Answer
Correct Answer: True
Q19.
डिफाइन कीवर्ड फ़ंक्शन ब्लॉक की शुरुआत को चिह्नित करता है।
Define keyword marks the beginning of the function block.
A.
True
B.
False
C.
can’t say
D.
None of these
View Answer
Correct Answer: False
Q20.
नंबर का पॉवर फाइंड करने के लिए किस फंक्शन का प्रयोग करते है
The function used to find power of a number.
A.
**
B.
power()
C.
pow()
D.
a and c both
View Answer
Correct Answer: a and c both
Q21.
निम्नलिखित पाइथन कोड का आउटपुट क्या होगा
What will be the output of the following Python code?def C2F(c):
return c*9/5+32
print(C2F(100))
print(C2F(0))
A.
212.0 32.0
B.
314 24
C.
567 98
D.
None of the above
View Answer
Correct Answer: 212.0 32.0
Q22.
निम्नलिखित स्टेटमेंट में सबसे लास्ट में कौन स्टेटमेंट एक्सीक्यूट होगा
Which of the following statement will execute in last?def s(n1): #Statement 1
print(n1) #Statement 2
n2=4 #Statement 3
s(n2) #Statement 4
A.
Statement 1
B.
Statement 2
C.
Statement 3
D.
Statement 4
View Answer
Correct Answer: Statement 2
Q23.
निम्नलिखित का आउटपुट क्या होगा
What is the output of the following?x = 'abcd'
for i in range(len(x)):
i.upper()
print(x)
A.
a b c d
B.
0 1 2 3
C.
error
D.
none of these
View Answer
Correct Answer: none of these
Q24.
निचे लिखे प्रोग्राम का आउटपुट क्या होगा ?
What is the output of the below program?def func(a, b=5, c=10):
print('a is', a, 'and b is', b, 'and c is', c)
func(3, 7)
func(25, c=24)
func(c=50, a=100)
A.
a is 7 and b is 3 and c is 10
a is 25 and b is 5 and c is 24
a is 5 and b is 100 and c is 50
B.
a is 3 and b is 7 and c is 10
a is 5 and b is 25 and c is 24
a is 50 and b is 100 and c is 5
C.
a is 3 and b is 7 and c is 10
a is 25 and b is 5 and c is 24
a is 100 and b is 5 and c is 50
D.
None of these
View Answer
Correct Answer: a is 3 and b is 7 and c is 10
a is 25 and b is 5 and c is 24
a is 100 and b is 5 and c is 50
Q25.
निम्नलिखित पायथन कोड का आउटपुट क्या होगा
What will be the output of the following Python code?x = 50
def func(x):
print('x is', x)
x = 2
print('Changed local x to', x)
func(x)
print('x is now', x)
A.
x is 50
Changed local x to 2
x is now 50
B.
x is 50
Changed local x to 2
x is now 2
C.
x is 50
Changed local x to 2
x is now 100
D.
None of these
View Answer
Correct Answer: x is 50
Changed local x to 2
x is now 50
Q26.
पाइथन में, निम्नलिखित में कौन सा बिल्ट-इन फंक्शन है |
In python, which of the following functions is a built-in function?
A.
val()
B.
print()
C.
func_k()
D.
None of these
View Answer
Correct Answer: print()
Q27.
निम्नलिखित कोड का आउटपुट क्या होगा
What will be the output of following code?x = ['XX', 'YY']
for i in x:
i.lower()
print(x)
A.
['XX', 'YY']
B.
['xx', 'yy']
C.
[XX, YY]
D.
None of these
View Answer
Correct Answer: ['XX', 'YY']
Q28.
निम्नलिखित में फंक्शन को कॉल करने का कौन सा एक तरीका सही है
Which one of the following is the correct way of calling a function?
A.
function_name()
B.
call function_name()
C.
ret function_name()
D.
function function_name()
View Answer
Correct Answer: function_name()
Q29.
यदि किसी फंक्शन के पास रिटर्न स्टेटमेंट नहीं है तो निम्नलिखित में से फंक्शन क्या रिटर्न करेगा |
If a function does not have a return statement, which of the following does the function return?
A.
int
B.
null
C.
An exception is thrown without return
D.
None
View Answer
Correct Answer: None
Q30.
फंक्शन को प्रोग्राम में कॉल करने के लिए फंक्शन का नाम के साथ .......... का प्रयोग करते है |
The function can be called in the program by writing function name followed by __________.
A.
[ ]
B.
{ }
C.
( )
D.
None of the above
View Answer
Correct Answer: ( )
Q31.
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?def say(message, times = 1):
print(message * times)
say('Hello')
say('World', 5)
A.
Hello
WorldWorldWorldWorldWorld
B.
Hello
HelloHelloHelloHelloHello
C.
Hello
World,World,World,World,World
D.
Hello
World5
View Answer
Correct Answer: Hello
WorldWorldWorldWorldWorld
Q32.
निम्नलिखित में कौन सा बिल्ट-इन फंक्शन नहीं है |
Which of the following is not the built-in function?
A.
input()
B.
tuple()
C.
print()
D.
dictionary()
View Answer
Correct Answer: dictionary()
Q33.
निम्नलिखित कोड से कौन सा नंबर कभी भी जनरेट नहीं होगा |
Which of the following number can never be generated by the following code:random.randrange(0, 50)
View Answer
Correct Answer: 50
Q34.
निम्नलिखित पाइथन कोड का आउटपुट क्या होगा |
What will be the output of the following Python code?from math import *
ceil(3.4)
A.
4
B.
3
C.
3.5
D.
None of these
View Answer
Correct Answer: 4
Q35.
निम्नलिखित पाइथन कोड का आउटपुट क्या होगा |
What will be the output of the following Python code?from math import factorial
print(math.sqrt(25))
A.
5.0
B.
Nothing is printed
C.
Error, method sqrt doesn’t exist in math module
D.
Error, the statement should be: print(sqrt(25))
View Answer
Correct Answer: Error, the statement should be: print(sqrt(25))
Q36.
निम्नलिखित कोड का आउटपुट क्या होगा |
What will be the output of the following code?import math
abs(math.sqrt(36))
A.
Error
B.
6
C.
-6
D.
6.0
View Answer
Correct Answer: 6.0
Q37.
निम्नलिखित में कौन सा आइटम फंक्शन हैडर में मौजूद होते है |
Which of the following items are present in the function header?
A.
function name
B.
parameter list
C.
return value
D.
Both (A) and (B)
View Answer
Correct Answer: Both (A) and (B)
Q38.
निम्नलिखित पाइथन कोड का आउटपुट क्या होगा |
What will be the output of the following Python code?min(max(False, -3, -4), 2, 7)
A.
-4
B.
-3
C.
2
D.
False
View Answer
Correct Answer: 2
Q39.
निम्नलिखित कोड का आउटपुट क्या होगा |
What is the output of the following?t=(2, 3, 4, 3.5, 5, 6)
print(sum(t) + t.count(2))
A.
24
B.
23.5
C.
24.5
D.
25.5
View Answer
Correct Answer: 24.5
Q40.
निम्नलिखित पाइथन कोड का आउटपुट क्या होगा |
What will be the output of the following Python code?def sayHello():
print("Hello World!")
sayHello()
sayHello()
A.
Hello World!
Hello World!
B.
'Hello World!'
'Hello World!'
C.
Hello
Hello
D.
None of the above
View Answer
Correct Answer: Hello World!
Hello World!
Q41.
निम्नलिखित में से कौन सा पायथन में फ़ंक्शन का उपयोग है?
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
Correct Answer: कार्य कार्यक्रमों के पुन: प्रयोज्य टुकड़े हैं/Functions are reusable pieces of programs
Q42.
सही फंक्शन हैडर की पहचान करे |
Identify the correct function header.
A.
def fun(a=2, b=3, c)
B.
def fun(a=2, b, c=3)
C.
def fun(a, b=2, c=3)
D.
def fun(a, b, c=3, d)
View Answer
Correct Answer: def fun(a, b=2, c=3)
Q43.
lstrip () विधि का उपयोग इसके लिए किया जाता है:
lstrip() method is used for:
A.
सभी अनुगामी वर्णों को हटा दें/delete all the trailing characters
B.
सभी प्रमुख पात्रों को हटा दें/delete all the leading characters
C.
सभी प्रमुख और अनुगामी वर्णों को हटा दें/delete all the leading and trailing characters
D.
अपरकेस वर्णों को हटा दें/delete upper case characters
View Answer
Correct Answer: सभी प्रमुख पात्रों को हटा दें/delete all the leading characters
Q44.
निम्नलिखित कोड का आउटपुट क्या होगा |
What is the output of the following code?def add(a, b):
return a+5, b+5
result = add(3, 2)
print(result)
A.
15
B.
8
C.
(8,7)
D.
Error
View Answer
Correct Answer: (8,7)
Q45.
निम्नलिखित पाइथन प्रोग्राम का आउटपुट क्या होगा |
What will be the output of the following Python program?def addItem(listParam):
listParam += [1]
mylist = [1, 2, 3, 4]
addItem(mylist)
print(len(mylist))
View Answer
Correct Answer: 5
Q46.
निम्नलिखित पाइथन कोड का आउटपुट क्या होगा |
What will be the output of the following Python code?from math import *
floor(3.7)
A.
3
B.
4
C.
3.0
D.
None of these
View Answer
Correct Answer: 3
Q47.
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?def cube(x):
return x * x * x
x = cube(3)
print(x)
View Answer
Correct Answer: 27
Q48.
निम्नलिखित कोड द्वारा कितनी संख्याएँ प्रिंट की जाएंगी?
How many numbers will be printed by the following code?def fun(a,b):
for x in range(a,b+1):
if x%3==0:
print(x, end=" ")
fun(100,120)
View Answer
Correct Answer: 7
Q49.
निम्नलिखित कोड क्या प्रिंट करता है?
What does the following code print?x = 'mohan'
for i in range(len(x)):
x[i].upper()
print(x)
A.
mohan
B.
MOHAN
C.
Error
D.
None of these
View Answer
Correct Answer: mohan
Q50.
नीचे दिए गए प्रोग्राम का आउटपुट क्या है?
What is the output of below program?def maximum(x, y):
if x > y:
return x
elif x == y:
return 'The numbers are equal'
else:
return y
print(maximum(2, 3))
A.
2
B.
3
C.
The numbers are equal
D.
None of the options
View Answer
Correct Answer: 3