What is the output when following statement is executed ?
>>>chr(ord('A'))
What error occurs when you execute?
apple = mango
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 = "snow world"
>>>print("%s" % example[4:7])
What is the output of the following?
print("abcdef".center())
What is the output of the following?
x = "abcdef"
i = "a"
while i in x[:-1]:
print(i, end = " ")
What is the output of the following?
for i in range(2.0):
print(i)
What does ~~~~~~5 evaluate to?
The output of which of the codes shown below will be: “There are 4 blue birds.”?
What is the output when following statement is executed ?
>>>"a"+"bc"
The output of executing string.ascii_letters can also be achieved by:
What is the value of this expression:
bin(10-2)+bin(12^4)
Which of the following is true for variable names in Python?
Following set of commands are executed in shell, what will be the output?
1.>>>str="hello"
2.>>>str[:2]
3.>>>
The output of the two codes shown below is the same. State whether this statement is true or false.
bin((2**16)-1)
'{}'.format(bin((2**16)-1))
The output of the snippet of code shown below?
bool(‘False’)
bool()
In order to store values in terms of key and value we use what core datatype.
What is the value of the expression:
float(4+int(2.39)%2)
What is the result of the expression:
int(1011)?
Mathematical operations can be performed on a string. State whether true or false.
What is the output of the following?
print('*', "abcde".center(6), '*', sep='')
What is the output when following code is executed ?
>>>print r"\nhello"
The output is
What is the value of the following expression:
24//6%3, 24//4//2
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 following?
for i in range(5):
if i == 5:
break
else:
print(i)
else:
print("Here")
What is the result of the expression:
0x35 | 0x75
What is the result of round(0.5) – round(-0.5)?
What is the output of the following?
i = 0
while i < 3:
print(i)
i += 1
else:
print(0)
What is the value of the following expression:
8/4/2, 8/(4/2)
What is the result of the snippet of code shown below if x=1?
x<<2
What is the output of the following expression if the value of x is 34?
print(“%f”%x)
What is the value of the expression:
4+2**5//10
What is the output of the following?
for i in [1, 2, 3, 4][::-1]:
print (i)
What is the output of the following?
print("abc DEF".capitalize())
Which of the following is invalid?
The output of the code shown below is:
s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')
What is the output of the following code ?
>>>example = "helle"
>>>example.rfind("e")
What is the output of the following?
x = "abcdef"
while i in x:
print(i, end=" ")
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.
Which of the following is an invalid statement?