What is the output when following statement is executed ?
>>>"abcd"[2:]
What is the output of the code shown below?
'%s' %((1.23,),)
Any odd number on being AND-ed with ________ always gives 1. Hint: Any even number on being AND-ed with this value always gives 0.
What is the output of the code shown below?
def mk(x):
def mk1():
print("Decorated")
x()
return mk1
def mk2():
print("Ordinary")
p = mk(mk2)
p()
What error occurs when you execute?
apple = mango
The expression shown below results in an error. State whether this statement is true or false.
print("-%5d0",989)
The output of which of the codes shown below will be: “There are 4 blue birds.”?
What is the output of the following?
for i in range(int(float('inf'))):
print (i)
What is the value of the following expression:
8/4/2, 8/(4/2)
What is the output of the following?
a = [0, 1, 2, 3]
for a[-1] in a:
print(a[-1])
What is the output of the following?
x = 123
for i in x:
print(i)
The value of the expression:
4 + 3 % 5
What is the output of the code shown below?
'%x %d' %(255, 255)
What is the value of this expression:
bin(10-2)+bin(12^4)
What is the output of the following?
d = {0, 1, 2}
for x in d:
print(d.add(x))
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
x[i].upper()
print (x)
What is the output of the following?
for i in [1, 2, 3, 4][::-1]:
print (i)
The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.
What is the output of the following?
print("abcdef".center(7, 1))
Following set of commands are executed in shell, what will be the output?
1.>>>str="hello"
2.>>>str[:2]
3.>>>
Which of the following Boolean expressions is not logically equivalent to the other three?
What is the output of “hello”+1+2+3 ?
What is the output of the code shown below?
'{0:.2f}'.format(1.234)
Which of these in not a core datatype?
The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same. State whether true or false.
Suppose i is 5 and j is 4, i + j is same as
What is the output of the following?
x = "abcdef"
i = "a"
while i in x:
print('i', end = " ")
Identify the decorator in the snippet of code shown below.
def sf():
pass
sf = mk(sf)
@f
def sf():
return
To return the length of string s what command do we execute ?
What is the result of cmp(3, 1)?
What is the output of the following expression if the value of x is 34?
print(“%f”%x)
What is the output of the following?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1
-
-
-
-
What is the output of the following?
print('*', "abcde".center(6), '*', sep='')
What is the output of print 0.1 + 0.2 == 0.3?
What is the return type of function id ?
Which one of the following have the same precedence?
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print(x)
What is the value of the expression:
float(4+int(2.39)%2)
To concatenate two strings to a third what statements are applicable ?