ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
print(pow(6, -1, 11), pow(4, -1, 9))
- A. 9 7
- B. 2 7
- C. 2 5
- D. 6 7
Correct answer: B. 2 7
6 * 2 = 12 is 1 mod 11, so the inverse of 6 is 2. 4 * 7 = 28 is 1 mod 9, so the inverse of 4 is 7.
More Python Programming questions
- What is printed? python print(int.frombytes(b'x01x00', 'big'), int.frombytes(b'x01x00', 'little'))
- What is printed? python print((255).tobytes(2, 'big'), (1).tobytes(3, 'little'))
- What is printed? python print(sorted(range(10), key=lambda x: (x % 3, -x))[:4])
- What is printed? python print(''.join(sorted('banana', reverse=True)), len(set('abcABC'.lower())), 'ABC'.isupper())
- Which implementation of "count how many times each character appears in s" is the best choice in Python when len(s) = 2 10^5?
- What is printed? python from itertools import accumulate print(list(accumulate([1, 2, 3], initial=0)), next(iter(sorted({3, 1, 2}))))