Home / CSE MCQs / Python MCQs :: Python Precedence and Associativity, Bitwise & Boolean

CSE MCQs :: Python MCQs

  1. What is the result of the expression if x=15 and y=12:
  2. A.
    b1101
    B.
    0b1101
    C.
    12
    D.
    1101

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Which of the following represents the bitwise XOR operator?
  4. A.
    &
    B.
    ^
    C.
    |
    D.
    !

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. What is the value of this expression:

     bin(10-2)+bin(12^4)
  6. A.
    0b10000
    B.
    0b10001000
    C.
    0b1000b1000
    D.
    0b10000b1000

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What is the two's complement of -44?
  8. A.
    1011011
    B.
    11010100
    C.
    11101011
    D.
    10110011

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. What is the output of the code shown below?

    not(3>4)
    not(1&1)
  10. A.

    True

    True

    B.

    True

    False

    C.

    False

    True

    D.

    False

    False

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. What is the output of the code shown below?

    class Truth:
    pass
    x=Truth()
    bool(x)
  12. A.
    pass
    B.
    true
    C.
    false
    D.
    error

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. What is the value of the following expression?

    2+4.00, 2**4.0
  14. A.
    (6.0, 16.0)
    B.
    (6.00, 16.00)
    C.
    (6, 16)
    D.
    (6.00, 16.0)

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. What is the value of x if:

    x = int(43.55+2/2)
  16. A.
    43
    B.
    44
    C.
    22
    D.
    23

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. What is the value of the following expression:

    24//6%3, 24//4//2
  18. A.
    (1,3)
    B.
    (0,3)
    C.
    (1,0)
    D.
    (3,1)

    View Answer

    Workspace

    Discuss Discuss in Forum