Home / CSE MCQs / Python MCQs :: Discussion

Discussion :: Python MCQs

  1. Which of these is a private data field?

    def Demo:
    def __init__(self):
        __a = 1
        self.__b = 1
        self.__c__ = 1
        __d__= 1
  2. A.
    __a
    B.
    __b
    C.
    __c__
    D.
    __d__

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Variables such as self.__b are private members of the class.


Be The First To Comment