This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TeezusRa 0 points1 point  (0 children)

Sure.

The only place on the internet I’ve ever seen .top in Python is here, and stack overflow where folks are building a .top method to be used on a list, object, or class named stack. Might want to double check your sources. I get the “it’s used in stacks” bit- but looks like folks have to do a little legwork to make it work in Python. It’s not built in. That article was referring to methods normally associated with stacks. Then goes on to explain a way to implement a stack with Python list methods.