Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

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

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

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    If the truth method is not defined, the object is considered true. Hence the output of the code shown above is true.


Be The First To Comment