Logo

Python Questions Set 150:

Quiz Mode

What is the output of the following Python code?

print(7//2)

1
2
3
4

Solution:

What will be the output of the following Python code?

print('1Rn@'.lower())

1
2
3
4

Solution:

Which of the following symbols matches the start of a string in a regular expression?

1
2
3
4

Solution:

What is the output of the given code?


a=11

b=4


print( ~ b)

print(a ^ b)

1
2
3
4

Solution:

 

What will be the output of the following Python statement?

>>> print('x\97\x98')

1
2
3
4

Solution:

What is the output of the following code?


tuple = [1, 2, 3, 4, 5]

tuple[1] += tuple[2]

print(tuple[1])

1
2
3
4

Solution:

What is the purpose of the Python getattr() function?

1
2
3
4

Solution:

What will be the output of the following Python code?

 

class fruits:
   def __init__(self, price):
       self.price = price
obj=fruits(50)
 
obj.quantity=10
obj.bags=2
 
print(obj.quantity+len(obj.__dict__))

1
2
3
4

Solution:

What will be the output of the following code?

a="WELCOME'S TO ABEKUS"
b='WELCOME\'S TO ABEKUS'
print(a)
print(b) 

1
2
3
4

Solution:

What is the difference between a compiler and an interpreter?

1
2
3
4

Solution: