ProgrammingModerateTCS NQT · Infosys
What is printed?
What is printed?
print(len(str(2**64)), sum(map(int, str(2**64))))
- A. 20 87
- B. 20 88
- C. 19 88
- D. 20 89
Correct answer: B. 20 88
2**64 is 18446744073709551616, which has 20 digits. Its digits add up to 88, and the exact integer keeps every digit.
More Python Programming questions
- What is printed? python print(all(int(c) % 2 == 0 for c in '24680'), any(c in 'aeiou' for c in 'rhythm'))
- What is printed? python print(''.join(c.upper() if i % 2 else c for i, c in enumerate('python')))
- What is printed? python print(' '.join(w[::-1] for w in 'hello big world'.split()))
- What is printed? python print(max(len(w) for w in 'the quick brown fox'.split()), [w for w in 'the quick brown fox'.split() if len(w) == 5])
- What is printed? python print(''.join(sorted('hello', key=lambda c: (c not in 'aeiou', c))))
- What is printed? python print(round(0.1 0.1, 3) == 0.01, round(2.345, 2), round(2.355, 2))