ProgrammingVery hardProduct-company MCQ pattern
What is printed?
What is printed?
x = 1 << 200 print(x.bit_length(), len(str(x)), x % 1000, (x >> 190) & 0xFF)
- A. 201 61 376 1024
- B. 200 61 376 0
- C. 201 61 376 0
- D. 201 60 376 0
Correct answer: C. 201 61 376 0
1 << 200 has bit length 201 and 61 decimal digits. Its last three digits are 376, and shifting right by 190 leaves 2**10, which is 0 after masking with 0xFF.
More Python Programming questions
- What is printed? python print(f'{210:,}', f'{210:x}', f'{210:b}', f'{-210:>8}'.strip())
- What is printed? python print(str(round(2.5)), str(round(3.5)), round(2.5 + 0.0001), round(-2.5 - 0.0001))
- What is printed? python s = 'ab' 2 + 'c' print(s.endswith('bc'), s.startswith('ab', 2), s.find('ab', 1), s.count('ab'))
- What is printed? python print(len(''.join(str(i) for i in range(1, 11))), ''.join(str(i) for i in range(1, 11))[-3:], sum(len(str(i)) for…
- What is the time complexity of checking whether a number n is prime by trial division up to its square root?
- What is printed? python from string import Template print(Template('a-b').substitute(a=1, b=2), Template('ac').safesubstitute(a='x')…