The result of the expression shown below is:
4^12
What is the output of the following expression if the value of x is 34?
print(“%f”%x)
Consider the expression given below. The value of X is:
X = 2+9*((3*12)-8)/10
What does 3 ^ 4 evaluate to?
What is the value of the following expression:
8/4/2, 8/(4/2)
What is the output of the following code ?
>>>example = "helle"
>>>example.rfind("e")
The output of executing string.ascii_letters can also be achieved by:
What is the output of the following code ?
>>>example = "helle"
>>>example.find("e")
What is the output of the following code ?
>>>example="helloworld"
>>>example[::-1].startswith("d")
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.
Which of the following Boolean expressions is not logically equivalent to the other three?
What is the output of the following?
x = 'abcd'
for i in x:
print(i)
x.upper()
What is the output of the following code if the system date is 21st June, 2017 (Wednesday)?
[ ] or {}
{} or [ ]
What is the output of the code shown below?
def c(f):
def inner(*args, **kargs):
inner.co += 1
return f(*args, **kargs)
inner.co = 0
return inner
@c
def fnc():
pass
if __name__ == '__main__':
fnc()
fnc()
fnc()
print(fnc.co)
Which of the following will run without errors ?
What is “Hello”.replace(“l”, “e”)
Given a string example=”hello” what is the output of example.count(l)
Which is the correct operator for power(x^y)?
What is the output of this expression if X= -122?
print("-%06d"%x)
What is the output of the following?
i = 1
while False:
if i%2 == 0:
break
print(i)
i += 2
Which of the following is incorrect?
What is the result of the snippet of code shown below if x=1?
x<<2
What is the output of the code shown?
a='hello'
q=10
vars()
What is the output of the code shown below?
l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))
What is the result of the expression if x=15 and y=12:
x & y
What is the output of the code shown?
x=3.3456789
'%f | %e | %g' %(x, x, x)
What is the output of the code shown?
x=3.3456789
'%s' %x, str(x)
To check whether string s1 contains another string s2, use
A function with parameters cannot be decorated. State whether true or false.
What is the output when following code is executed ?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
What is the return type of function id ?
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"))
Which of the following results in a SyntaxError ?
What is the output of the following?
for i in [1, 2, 3, 4][::-1]:
print (i)
What is the return value of trunc() ?
What is the output of the following?
print('*', "abcde".center(6), '*', sep='')
What error occurs when you execute?
apple = mango
Which of the following is invalid?
Fill in the blanks:
The formatting method {1:<10} represents the ___________ positional argument, _________ justified in a 10 character wide field.
What is the output of the following?
for i in range(5):
if i == 5:
break
else:
print(i)
else:
print("Here")