Python Quiz

271. What will this output?

x = {'a': 1, 'b': 2}
print(x.get('c', 3))
272. What is the output of:

print(bool(''))
273. Which of the following will remove a key from a dictionary?
274. What does the `enumerate()` function return?
275. What is the output of:

print([1, 2] * 2)
276. Which of the following is used to define a block of code in Python?
277. Which method is used to return the number of items in a dictionary?
278. What will be the output of:

x = 5
def foo():
    x = 10
foo()
print(x)
279. Which of the following is used to define a class method?
280. Which Python module is used for regular expressions?

Explore Programming Topics