Saturday, 18 April 2020

Python Stack as class



class Stack:    # defining the Stack class
    def __init__(self):    # defining the constructor function
        print("Hi!")

stackObject = Stack()    # instantiating the object

No comments:

Post a Comment