Logo

Python Questions Set 161:

Quiz Mode

 What does ~4 evaluate to? 

1
2
3
4

Solution:

What is the output of the given code?


print("Hi # there!!!")

1
2
3
4

Solution:

 

What will be the output of the following Python code?

>>> a=(0,1,2,3,4)
>>> b=slice(0,2)
>>> a[b]

1
2

Solution:

_____ is basically an abstract class that actually represents a column in the database table.

1
2
3
4

Solution:

What is the output of the following code?


a = 3

b = 4

a, b, c = b, a, a

a = a, b, c

print(a)

1
2
3
4
5

Solution:

Right shift of a number by one bit is the same as ____?

1
2
3
4

Solution:

What is the output of the given code?


y={3:'a',4:'b'}


print(3 in y)


print('b' in y)



1
2
3
4

Solution:

Which exception will be raised if a database query won't return any result?

1
2
3
4

Solution:

What will be the output of the following Python code?

a={1:5,2:3,3:4}
a.pop(3)
print(a)

1
2
3
4

Solution:

Which of the following functions can help us to find the version of python that we are currently working on?

1
2
3
4

Solution: