What does the zip() function do when iterables of different lengths are passed? Python DeveloperMedium Try Now
What is the output of the following? try: x = 1 / 0 except ZeroDivisionError: x = -1 finally: print(x) Python DeveloperMedium Try Now
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