ProgrammingVery hardTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
print(pow(7, 222, 13), pow(7, 6, 13))
- A. 6 12
- B. 12 12
- C. 1 12
- D. 12 1
Correct answer: B. 12 12
7 has order 12 modulo 13, and 7^6 is -1 mod 13, which is 12. Since 222 mod 12 = 6, the first value is 12 too.
More Python Programming questions
- What is printed? python print(max(map(len, ['ab', 'cde', 'f'])), sorted([[2, 1], [1, 5], [1, 2]]))
- What is printed? python print(list(enumerate('ab', start=5)))
- What is printed? python print(int(3.99999999999999999), int(-0.9))
- What is printed? python print('{0}{1}{0}'.format('a', 'b'), '{:>3}'.format(7), '%%%d' % 5)
- What is printed? python print(bin(5 << 2), 5 >> 1, -5 >> 1, -5 // 2)
- What is printed? python print(1 if 0 else 2 if 3 else 4, 0 or '' or 'z', 0 and 'z')