ProgrammingVery hardProduct-company MCQ pattern
What is printed?
What is printed?
print(len(str(7**77)), 7**77 % 1000, str(7**77)[-3:], int(str(7**77)[:3]))
- A. 66 207 207 117
- B. 66 206 207 118
- C. 65 207 207 118
- D. 66 207 207 118
Correct answer: D. 66 207 207 118
7 to the power 77 has 66 digits. Its last three digits give the same value as 7**77 % 1000, and its leading three digits are 118.
More Python Programming questions
- What is printed? python def rpn(tokens): st = [] for t in tokens: if t in ('+', '-', '', '/'): b = st.pop() a = st.pop() if t == '+'…
- What is printed? python def ceildiv(a, b): return -(-a // b) print(ceildiv(7, 2), ceildiv(-7, 2), ceildiv(6, 3), ceildiv(1, 5))
- What is printed? python def atmost(a, k): l = s = c = 0 for r, x in enumerate(a): s += x while s > k: s -= a[l] l += 1 c += r - l + 1…
- What is printed? python from itertools import accumulate a = [3, 1, 4, 1, 5, 9, 2] print(list(accumulate(a, max)), list(accumulate(a…
- What is printed? python def comps(n, edges): p = list(range(n)) def find(x): while p[x] != x: p[x] = p[p[x]] x = p[x] return x cnt = n for…
- What is printed? python def spiral(m): out = [] while m: out += m.pop(0) m = [list(r) for r in zip(m)][::-1] return out print(spiral([[1…