Logo

Python Questions Set 94:

Quiz Mode

Which is truncation division operator?

1
2
3
4

Solution:

import sys


sys.stdin.readline( )


Abekus

1
2
3
4

Solution:

Is Python case sensitive when dealing with identifiers?

1
2
3
4

Solution:

 

What will be the output of the following Python expression?

bin(29)

1
2
3

Solution:

Given the list a = [11, 42, 23, 14], what will be the output of the following code?

if (k := len(a)) > 3:

print(k+1)

1
2
3
4

Solution:

What will be the output when the following Python code is executed?

d1 = {"john":40, "peter":45}

d2 = {"john":466, "peter":45}

d1 > d2

1
2
3
4

Solution:

 

The output of both of the print statements is the same.

import datetime
dt_1 = datetime.datetime.today()
dt_2 = datetime.datetime.now()
print(dt_1)
print(dt_2)

1
2

Solution:

What will be the output of the following Python code?

>>> a={1:"A",2:"B",3:"C"}
>>> a.items()

1
2
3
4

Solution:

What will be the output of the following code?

a = {3, 6, 10, 7, 12, 11}
b = {7, 5, 6, 8, 9, 10}
c = a | b
d = a.union(b)
if c == d:
print("Equal")
else:
print("Not Equal")

1
2
3
4

Solution:

 The number of lines drawn in each case, assuming that the turtle module has been imported: 

 

Case 1:
for i in range(0,10):
turtle.forward(100)
turtle.left(90)
Case 2:
for i in range(1,10):
turtle.forward(100)
turtle.left(90)

1
2
3
4

Solution: