What is the output of the following code?
hex(255), int('FF', 16), 0xFF
Which one of the following have the highest precedence in the expression?
Which of these in not a core datatype?
Is Python case sensitive when dealing with identifiers?
What is the value of this expression:
bin(10-2)+bin(12^4)
What is the output of the code shown?
def ordi():
print("Ordinary")
ordi
ordi()
What is the output of the following?
x = 'abcd'
for i in range(x):
print(i)
What is the output of the following?
i = 5
while True:
if i%0O11 == 0:
break
print(i)
i += 1
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d.items():
print(x, y)
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
i.upper()
print (x)
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for i in d:
print(i)
The expression Int(x) implies that the variable x is converted to integer. State whether true or false.
What is the output of the following?
for i in range(2.0):
print(i)
What is the output of the following?
for i in range(10):
if i == 5:
break
else:
print(i)
else:
print("Here")
A function with parameters cannot be decorated. State whether true or false.
What is the output of the following?
x = 'abcd'
for i in range(len(x)):
print(x)
x = 'a'
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 when following statement is executed ?
>>>print('new' 'line')
What is the output of the code shown below?
l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))
Given a function that does not return any value, What value is thrown by default when executed in shell.
What is the output of the following expression if the value of x is 34?
print(“%f”%x)
Which of the following is incorrect?
What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x in d.values():
print(x)
What is the output of this expression if x=22.19?
print("%5.2f"%x)
What is the output of the following?
print("abc DEF".capitalize())
What is the output of the code shown below if the system date is 18th August, 2016?
x=1234
res='integers:...%d...%-6d...%06d' %(x, x, x)
res
Consider the expression given below. The value of X is:
X = 2+9*((3*12)-8)/10
What is the value of the expression:
~100?
Consider the snippet of code shown below and predict the output.
X=”san-foundry”
print(“%56s”,X)
The output of the expression is:
bin(29)
What dataype is the object below ?
L = [1, 23, ‘hello’, 1].
What is the output of the following?
print("abc. DEF".capitalize())
The output of the snippet of code shown below is:
'%d %s %g you' %(1, 'hello', 4.0)
What does ~4 evaluate to?
The expression 2**2**3 is evaluates as: (2**2)**3. State whether this statement is true or false.
Which among the following list of operators has the highest precedence?
+, -, **, %, /, <<, >>, |
What is the output when following code is executed ?
>>>print r"\nhello"
The output is
What is the output of the code shown below?
'%s' %((1.23,),)
What is the result of cmp(3, 1)?
What is the output of the following?
string = "my name is x"
for i in string:
print (i, end=", ")