What is the output of the following? d = {‘a’: 1, ‘b’: 2} d2 = {**d, ‘b’: 99, ‘c’: 3} print(d2) 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 does the zip() function do when iterables of different lengths are passed? 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