Hello Joe, Nice video. I have a suggestion, in the peek functions rather than writing "return self.stack[len(self.stack)-1]" why not just write return self.stack[-1] makes the code much cleaner and much crisp. One question what is a Wrapper Class?
@riskzerobeatz4 жыл бұрын
return self.stack[-1:]
@miyakakinshasa254 жыл бұрын
how did Python know it was a stack though??
@shivammaurya84723 жыл бұрын
It doesn't, actually the operations we do on lists are similar to a stack, he just showed us how we can use that functionality and how can we even create our own stack class by using list functionality.