English

In the following code, function x is a function defined to: def x (glassStack): if isEmpty (glassStack): print ('underflow') return None else: return (glassStack.pop ())

Advertisements
Advertisements

Question

In the following code, function x is a function defined to:

         def x (glassStack):
                   if isEmpty (glassStack):
                         print ('underflow')
                         return None
               else:
                        return (glassStack.pop ())

Options

  • Delete the topmost element if stack is not empty

  • Prevent underflow condition

  • Check if the stack is empty

  • All of the above

MCQ
Advertisements

Solution

All of the above

Explanation:

All of the options given are implemented by the function.

shaalaa.com
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×