The code shown above can work with ____ parameters.
def f(x):
def f1(*args, **kwargs):
print("Sanfoundry")
return x(*args, **kwargs)
return f1
Which of the following is incorrect?
Suppose i is 5 and j is 4, i + j is same as
The one’s complement of 110010101 is:
What function do you use to read a string?
What is the output of the following?
x = 'abcd'
for i in x:
print(i.upper())
What is the output of the following?
for i in range(5):
if i == 5:
break
else:
print(i)
else:
print("Here")
What is the output of the code shown below?
'%.2f%s' % (1.2345, 99)
Mathematical operations can be performed on a string. State whether true or false.
Identify the decorator in the snippet of code shown below.
def sf():
pass
sf = mk(sf)
@f
def sf():
return
What is the output of the code shown below?
class Truth:
pass
x=Truth()
bool(x)
What is the output of the following?
x = 2
for i in range(x):
x += 1
print (x)
Which among the following list of operators has the highest precedence?
+, -, **, %, /, <<, >>, |
What is the output of “hello”+1+2+3 ?
What is the result of round(0.5) – round(-0.5)?
What is the output of the following?
x = "abcdef"
i = "i"
while i in x:
print(i, end=" ")
What is the order of precedence in python?
i) Parentheses
ii) Exponential
iii) Division
iv) Multiplication
v) Addition
vi) Subtraction
Given a function that does not return any value, What value is thrown by default when executed in shell.
What is the value of the expression:
4+2**5//10
What is the output of the following?
print('*', "abcdef".center(7), '*')
What is the output of the following?
x = "abcdef"
i = "a"
while i in x[:-1]:
print(i, end = " ")
Which of the following formatting options can be used in order to add ‘n’ blank spaces after a given string ‘S’?
What is the output of the code shown?
x=3.3456789
'%s' %x, str(x)
What is the result of the snippet of code shown below if x=1?
x<<2
What is the output of the following code ?
class Count:
def __init__(self, count = 0):
self.__count = count
c1 = Count(2)
c2 = Count(2)
print(id(c1) == id(c2), end = " ")
s1 = "Good"
s2 = "Good"
print(id(s1) == id(s2))
What is the output when following statement is executed ?
>>>chr(ord('A'))
What is the output of the code shown?
x=3.3456789
'%f | %e | %g' %(x, x, x)
What is the output of the following?
a = [0, 1, 2, 3]
for a[0] in a:
print(a[0])
What is the output of the following?
print("abcdef".center(0))
Which of the following is not a complex number?
What is the output of the following?
d = {0, 1, 2}
for x in d.values():
print(x)
What is the output of the following code ?
>>>example = "helle"
>>>example.find("e")
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d:
print(x, y)
What is the result of the expression:
int(1011)?
All keywords in Python are in
What is the output of the following?
print("abc DEF".capitalize())
What is the output of the code shown?
a='hello'
q=10
vars()
What is the output of the following?
i = 2
while True:
if i%3 == 0:
break
print(i)
i += 2
The output of which of the codes shown below will be: “There are 4 blue birds.”?
Which one of the following have the highest precedence in the expression?