ProgrammingVery hardJEE Advanced · CAT placement
What is printed?
What is printed?
print(int(str(2**64) * 0 + '7') ** 2, len(str(7 ** 100)), 7 ** 100 % 10)
- A. 49 85 1
- B. 49 84 1
- C. 48 85 1
- D. 49 85 7
Correct answer: A. 49 85 1
Multiplying a string by 0 gives an empty string, so the int is 7 and its square is 49. 7**100 has 85 digits, and since 7**4 ends in 1, 7**100 also ends in 1.
More Python Programming questions
- What is printed? python from itertools import product print(list(map(''.join, product('ab', repeat=2))))
- What is printed? python print(sum(range(10 6)) % 1000, sum(range(1, 11)) // 5)
- What is printed? python print(('a' 'b' 'c').upper(), 'x' 'y' 2, ('%d' % 3) 2)
- What is printed? python print(1e16 == 1016, 1e16 + 1 == 1016 + 1, 1e16 + 2 == 1016 + 2, int(1e16) + 1)
- What is printed? python print('%.2e' % 0, '%.1f' % 2.25, '%.1f' % 2.35, '%5.1f|' % -0.04)
- What is printed? python x = 0.1 print((0.5).asintegerratio(), (0.1).asintegerratio()[1] == 255)