ProgrammingVery hardProduct-company MCQ pattern
What is printed?
What is printed?
print(int('1' * 30) % 97, pow(10, 30, 97), (10**30 - 1) // 9 % 97)- A. 74 85 73
- B. 74 85 74
- C. 75 85 74
- D. 74 84 74
Correct answer: B. 74 85 74
The 30-digit string of ones is the same number as (10**30 - 1) // 9, so the first and third values match. pow with a modulus gives the remainder of 10**30 directly, which is 85.
More Python Programming questions
- What is printed? python print(sum(int(c) for c in str(21000)), len(str(21000)))
- What is printed? python print(len(set(str(i i) for i in range(10))), sorted([(-1) i i for i in range(6)]))
- What is printed? python print(list(map(round, [0.5, 1.5, 2.5, -0.5, -1.5])), list(map(int, [0.5, 1.5, 2.5, -0.5, -1.5])))
- What is printed? python print(max(['10', '9']), max(['10', '9'], key=len), sorted(['10', '9', '100'], key=lambda s: (len(s), s)))
- What is printed? python print(int(True) - ~True, 4 >> True, True << 3, True + True True)
- What is printed? python print('5' 3 > '10' 2, 5 3 > 10 2, '55' < '9', 55 < 9)