ProgrammingVery hardJEE Main · CAT placement
What is printed?
What is printed?
print(0o777 ^ 0o070, 0b1111 & 0xF0 | 0x0F, 1_000_000 // 1e3)
- A. 455 15 1000
- B. 447 15 1000.0
- C. 455 15 1000.0
- D. 455 255 1000.0
Correct answer: C. 455 15 1000.0
0o777 is 511 and 0o070 is 56, and their xor is 455. & binds tighter than |, so the second value is 0 | 15. Floor division with a float gives a float.
More Python Programming questions
- What is printed? python s = 'Straße' print(s.upper(), s.lower(), s.casefold() == 'strasse', len(s.upper()))
- What is printed? python print(0.1 0.1 == 0.01, 0.1 0.1, round(0.1 0.1, 2) == 0.01)
- What is printed? python print(int(3.99999999999999999), int(-3.7), 3.99999999999999999 == 4.0, 3)
- What is printed? python s = 'x' 3 print(s -1 == '', s.replace('x', 'xy', 2), s.count('xx'), s.index('x', 1))
- What is printed? python print(' '.join(str(i) for i in range(3)), ','.join(f'{i:02d}' for i in (1, 10)), '|'.join(['x']), ''.join([''…
- What is printed? python print(max(3, 3.0), max(3.0, 3), min(-0.0, 0), min(0, -0.0))