Q: What will be the output of the following Python code? x = [[0], [1]] print((.join(list(map(str, x)))))
Solution: (element) is the same as element. It is not a tuple with one item.
Q: What will be the output of the following Python code? x = [[0], [1]] print((.join(list(map(str, x))),))
Solution: (element,) is not the same as element. It is a tuple with one item.
Q: What will be the output of the following Python code? x = [34, 56] print(('.join(list(map(str, x))),))
Solution: We have created a tuple with one string in it.
Q: What will be the output of the following Python code? x = [34, 56] print(('.join(list(map(str, x)))),)
Solution: We have just created a string.
Q: What will be the output of the following Python code? x = [34, 56] print(len(map(str, x)))
Solution: TypeError, map has no len.
Q: What will be the output of the following Python code? x = abcd print(list(map(list, x)))
Solution: NameError, we have not defined abcd.
Q: What will be the output of the following Python code? x = 1234 print(list(map(list, x)))
Solution: TypeError, int is not iterable.
Q: What will be the output of the following Python code? x = 1234 print(list(map(list, [x])))
Solution: TypeError, int is not iterable.
You Have Score    | /8 |