ProgrammingHardProduct-company MCQ pattern
What is printed?
What is printed?
print(str(2**100)[:5], len(str(2**100)), str(2**100).count('0'))- A. 12676 30 6
- B. 12676 31 5
- C. 12676 31 6
- D. 12675 31 6
Correct answer: C. 12676 31 6
2 to the power 100 has 31 digits, and its first five digits are 12676. Six of those digits are zeros.
More Python Programming questions
- What is printed? python print(int('9' 5) 2 // 109, (109 - 1) 2 // 109)
- What is printed? python x = 0 for i in range(1, 101): x += i print(x, x // 2 2 == x, x % 2)
- What is printed? python print(','.join(['a', 'b']), ','.join('ab'), '%s' % ['a', 'b'], str(('a',)))
- What is printed? python import math print(math.prod([2, 3, 4]), math.prod([]), math.prod([1.5, 2]), math.prod(range(1, 6)) ==…
- What is printed? python words = ['bb', 'a', 'ccc'] print(max(words), max(words, key=len), min(words, key=len), sorted(words, key=lambda w…
- What is printed? python print(len(f'{1234.5:.0f}'), f'{1234.5:.0f}', f'{1235.5:.0f}', f'{-1234.5:.0f}')