What is the expected output of the following code?
mytu = ('a', 'b', 'c')
m = tuple(map(lambda x: chr(ord(x) + 1), mytu))
print(m[-2])
What is the expected output of the following code?
mytu = ('a', 'b', 'c')
m = tuple(map(lambda x: chr(ord(x) + 1), mytu))
print(m[-2])
The code snippet converts each character in the tuple 'mytu' ('a', 'b', 'c') to the next character in the ASCII sequence using a lambda function inside the map function. The characters 'a', 'b', and 'c' will be converted to 'b', 'c', and 'd' respectively. When the result is converted back to a tuple and stored in 'm', it becomes ('b', 'c', 'd'). Accessing the second last element, m[-2], will give 'c'.
D right answer
D is the correct