What will be displayed by print(ord(‘b’) – ord(‘a’)) ?
What is the output of the following code ?
>>>example="helloworld"
>>>example[::-1].startswith("d")
What is the output of print 0.1 + 0.2 == 0.3?
The output of the line of code shown below is:
not(10<20) and not(10>30)
What is the result of the snippet of code shown below if x=1?
x<<2
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.keys():
print(d[x])
What is the output of this expression if x=22.19?
print("%5.2f"%x)
What is the output of the following?
print('*', "abcdef".center(7), '*', sep='')
What is the output of the following?
x = (i for i in range(3))
for i in x:
print(i)
What is the output when following statement is executed ?
>>>print(chr(ord('b')+1))
What does 3 ^ 4 evaluate to?
What does ~4 evaluate to?
What is the output when following statement is executed ?(python 3.xx)
>>>print(format("Welcome", "10s"), end = '#')
>>>print(format(111, "4d"), end = '#')
>>>print(format(924.656, "3.2f"))
What is the output of the code shown below?
def f(x):
def f1(a, b):
print("hello")
if b==0:
print("NO")
return
return f(a, b)
return f1
@f
def f(a, b):
return a%b
f(4,0)
What is the output of the following?
x = "abcdef"
i = "a"
while i in x[1:]:
print(i, end = " ")
What is the output when following code is executed ?
>>>print("D", end = ' ')
>>>print("C", end = ' ')
>>>print("B", end = ' ')
>>>print("A", end = ' ')
What is the return type of function id ?
What function do you use to read a string?
It is not possible for the two’s complement value to be equal to the original value in any case. State whether this statement is true or false.
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
i[x].upper()
print (x)
What is the output of the code shown below?
class A:
@staticmethod
def a(x):
print(x)
A.a(100)
What is the output of the following?
string = "my name is x"
for i in string:
print (i, end=", ")
The value of the expression:
4 + 3 % 5
What is the value of this expression?
bin(0x8)
What is the value of the expression:
float(4+int(2.39)%2)
To return the length of string s what command do we execute ?
Suppose i is 5 and j is 4, i + j is same as
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?
d = {0, 1, 2}
for x in d:
print(x)
What is the output of the following?
print('*', "abcde".center(6), '*', sep='')
What is the output of the following code ?
>>>example = "snow world"
>>>print("%s" % example[4:7])
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?
i = 1
while True:
if i%2 == 0:
break
print(i)
i += 2
If a class defines the __str__(self) method, for an object obj for the class, you can use which command to invoke the __str__ method.
What is the output of the following?
x = "abcdef"
i = "a"
while i in x:
print('i', end = " ")
What is the output of “hello”+1+2+3 ?
The output of which of the codes shown below will be: “There are 4 blue birds.”?
What is the output of the code shown below?
'The {} side {1} {2}'.format('bright', 'of', 'life')
Consider the expression given below. The value of X is:
X = 2+9*((3*12)-8)/10
What is the output of the following?
for i in [1, 2, 3, 4][::-1]:
print (i)