What is answer of this expression, 22 % 3 is?
To find the decimal value of 1111, that is 15, we can use the function:
What is the value of the following expression:
8/4/2, 8/(4/2)
What is the output of the code shown below?
class A:
@staticmethod
def a(x):
print(x)
A.a(100)
What is the average value of the code that is executed below ?
>>>grade1 = 80
>>>grade2 = 90
>>>average = (grade1 + grade2) / 2
What is the output when following statement is executed ?
>>>print(chr(ord('b')+1))
What is the output of the following?
x = "abcdef"
i = "a"
while i in x:
print(i, end = " ")
The output of the two codes shown below is the same. State whether true or false.
'{0:.2f}'.format(1/3.0)
'%.2f'%(1/3.0)
What is the output of the following?
string = "my name is x"
for i in ' '.join(string.split()):
print (i, end=", ")
What is the output of the following?
x = 2
for i in range(x):
x -= 2
print (x)
The output of which of the codes shown below will be: “There are 4 blue birds.”?
What is the return type of function id ?
What are the values of the following expressions:
2**(3**2)
(2**3)**2
2**3**2
What is the output of the following?
i = 5
while True:
if i%0O9 == 0:
break
print(i)
i += 1
What is the output when following statement is executed ?
>>>print('new' 'line')
What is the output when following statement is executed ?
>>>"abcd"[2:]
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 is the value of the following expression:
24//6%3, 24//4//2
What is the output of the following?
print('*', "abcdef".center(7), '*', sep='')
What is the result of the expression:
int(1011)?
What is the output of the following?
print('*', "abcdef".center(7), '*')
What is the output when following code is executed ?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
The expression shown below results in an error. State whether this statement is true or false.
print("-%5d0",989)
Which of the following represents the bitwise XOR operator?
What are the output of the code shown below?
def f(x):
def f1(*args, **kwargs):
print("*"* 5)
x(*args, **kwargs)
print("*"* 5)
return f1
def a(x):
def f1(*args, **kwargs):
print("%"* 5)
x(*args, **kwargs)
print("%"* 5)
return f1
@f
@a
def p(m):
print(m)
p("hello")
What is the output of the following?
string = "my name is x"
for i in string.split():
print (i, end=", ")
What is the output of the following?
for i in range(0):
print(i)
What is the output of the code shown below?
'The {} side {1} {2}'.format('bright', 'of', 'life')
What is the output of the code shown?
x=3.3456789
'%f | %e | %g' %(x, x, x)
Which of the following is the truncation division operator?
What is the output of the following?
i = 0
while i < 3:
print(i)
i += 1
else:
print(0)
What is the output of the code shown below?
'%x %d' %(255, 255)
What is the output of the code shown below?
'%s' %((1.23,),)
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print(d[x])
What is the output of the following?
x = 'abcd'
for i in range(x):
print(i)
What is the output of the code shown?
s='%s, %s & %s'
s%('mumbai', 'kolkata', 'delhi')
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
i.upper()
print (x)
Which of the following expressions is an example of type conversion?
What is the output of the following?
a = [0, 1, 2, 3]
i = -2
for i not in a:
print(i)
i += 1
Which of the following expressions involves coercion when evaluated in Python?