• Python question of the day

    Which of the following python statements will not be ignored by python interpreter, but the interpreter does nothing at run time as the intended use of the statement is to act as a stand-in or placeholder inside a class or function definition?
     # This is a comment)
     ''' This is doc string '''
     None
     pass
    Explanation:
    In python, pass does nothing at run time, and its major use is to act as a stand-in or placeholder inside a class or function definition (it holds a place to be filled in later with other statements) The difference between pass and a comment is that comment is ignored by the interpreter whereas pass is not ignored.


    Top 100 python interview questions:



  • Apply for an intership with Datai Analytics by filling your email, name and phone number