Python Quiz

261. What is the output of:

print(type(lambda x: x))
262. What does the `strip()` method do to a string?
263. Which function would you use to read the entire contents of a file into a string?
264. What is the result of:

all([True, 1, 'a'])
265. What is the output of:

print({x: x**2 for x in range(3) if x % 2 == 1})
266. What will this return?

'def' in {'abc', 'def', 'ghi'}
267. Which method is used to check if a string starts with a certain substring?
268. What does this code print?

print(list(range(5, 0, -2)))
269. Which of these is a valid way to merge two sets `a` and `b`?
270. What is the correct way to define a default value in a function parameter?

Explore Programming Topics