ProgrammingModerateTCS NQT · Infosys
What is printed?
What is printed?
print(10 ** 2 == 100.0, 2 ** 0.5 ** 2 == 2 ** 0.25, pow(4, 0.5))
- A. True True 2.0
- B. True True 2
- C. True False 2.0
- D. False True 2.0
Correct answer: A. True True 2.0
Exponentiation is right-associative, so 2 ** 0.5 ** 2 is 2 ** 0.25. pow with a float exponent returns a float, so pow(4, 0.5) is 2.0.
More Python Programming questions
- What does ','.join([1, 2]) do in Python 3?
- Which statement about the heapq module is correct?
- What is printed? python print(sum(range(1, 10 5 + 1, 7)))
- What is printed? python print(pow(7, 222, 13), pow(7, 6, 13))
- What is printed? python print(max(map(len, ['ab', 'cde', 'f'])), sorted([[2, 1], [1, 5], [1, 2]]))
- What is printed? python print(list(enumerate('ab', start=5)))