ProgrammingHardTCS NQT · Wipro pattern
What is printed?
What is printed?
print(list(map(pow, [2, 3], [3, 2])))
- A. [8, 9]
- B. [6, 6]
- C. [8, 6]
- D. [9, 8]
Correct answer: A. [8, 9]
pow is applied pairwise to the two lists, giving 2 to the power 3 and 3 to the power 2.
More Python Programming questions
- What is printed? python print(min(['10', '9', '2']), min([10, 9, 2]))
- What is printed? python s = {1, 2} t = s t |= {3} print(s, s is t)
- What is printed? python print(int(3.99), int(-3.99), round(3.5), round(4.5))
- What is printed? python print('ab' in ['ab', 'cd'], 'ab' in 'cdab', [] in [[]])
- What is printed? python x = [1, 2, 3] del x[::2] print(x)
- What is printed? python print(max(map(len, ['aa', 'b', 'ccc'])))