What is the output of the following? from functools import reduce result = reduce(lambda acc, x: acc + x, [1, 2, 3, 4], 10) print(result) Python DeveloperMedium Try Now
What is the output of the following? def gen(): yield from range(3) print(list(gen())) Python DeveloperMedium Try Now
Which of the following correctly unpacks a nested list using a list comprehension? Python DeveloperMedium Try Now
What is the output of the following? print([x for x in range(5) if x % 2 == 0]) Python DeveloperMedium Try Now
What does Python’s collections.defaultdict do differently from a regular dict? Python DeveloperMedium Try Now
What is the difference between a class method and a static method in Python? Python DeveloperMedium Try Now
What is the output of the following? a = (1, 2, 3) b = (1, 2, 3) print(a == b, a is b) Python DeveloperMedium Try Now
Which statement correctly describes Python’s GIL (Global Interpreter Lock)? Python DeveloperMedium Try Now
What is the output of the following? def f(a, b=[]): b.append(a) return b print(f(1)) print(f(2)) Python DeveloperMedium Try Now