ProgrammingHardTCS NQT · Wipro pattern
What is printed?
What is printed?
import math print(sum(map(int, str(math.factorial(10)))))
- A. 27
- B. 26
- C. 28
- D. 30
Correct answer: A. 27
10! is 3628800, and its digits 3, 6, 2, 8, 8, 0, 0 add up to 27.
More Python Programming questions
- What is printed? python x = 'abc' print(x.islower() and x.isalpha(), ''.isdigit())
- What is printed? python it = iter('ab') print(next(it), list(it), next(it, 'end'))
- What is printed? python print([n for n in range(8) if n and n & (n - 1) == 0])
- What is printed? python import heapq a = [5, 1, 4] heapq.heapify(a) print([heapq.heappop(a) for in range(len(a))], a)
- What is printed? python vals = [y for x in range(5) if (y := x x) % 2 == 0] print(vals)
- What is printed? python from functools import partial f = partial(int, base=2) print(f('101'), f('11', base=10))