GiovanniBruno22 / PythonBeginners

This repository is meant for new developers to submit first pull requests to and get reviews from peers.
17 stars 22 forks source link

i added stack operation successfully #47

Closed ak3255 closed 9 months ago

Ttibsi commented 10 months ago

This looks like a really good first attempt! A few suggestions: You could make the stack a class and make peek(), pop() and push() methods on it instead of passing the stack to each function. (For extra complexity points, you can even replace disp() with a __repr__ method).

We also want to wrap your while loop in a main() function and use the standard if __name__ == '__main__' convention -- you can see an example of that here. This'll stop your code from being run from outside this script, preventing other things messing with it's runtime. (It's just generally good practice)

Ttibsi commented 9 months ago

It's looking a lot better! This is going really well -- I hope it's clear why I'm suggesting the changes here. :)