ProgrammingHardProduct-company MCQ pattern
What is printed?
What is printed?
print(len(str(3**100)), str(3**100)[-1], str(3**100)[:3])
- A. 48 1 515
- B. 48 9 515
- C. 49 1 515
- D. 48 1 516
Correct answer: A. 48 1 515
3 to the power 100 has 48 digits. Powers of 3 cycle every four in the last digit, 3, 9, 7, 1, and 100 is a multiple of four, so the last digit is 1.
More Python Programming questions
- What is printed? python s = 'x' t = s s = s + 'y' print(t, s, t is s)
- What is printed? python print(''.join(map(chr, [72, 105])), ord('A') > 127, len('ab'.encode('utf-8')))
- What is printed? python print(list('hi'.encode('utf-16-le')), len('hi'.encode('utf-32')))
- What is printed? python print(bytes([104, 105]).decode(), bytes(b'ab').hex(), bytes([10, 255]).hex())
- What is printed? python print(f'{0.1:.1f}', f'{0.25:.1f}', f'{0.35:.1f}', f'{0.45:.1f}')
- What is printed? python print(5 // 2 2, 5 >> 2, 5 / 2 2)