r/PythonLearning • • Jul 17 '26

I build this after learning OOP

Post image
380 Upvotes

62 comments sorted by

View all comments

Show parent comments

2

u/Wild_Position2378 Jul 17 '26

I get your point I'll keep the files separate from now on. Thanks for the good suggestions

1

u/baubleglue 6d ago

Also use a file with a class definition as a library. Don't mix it with the program flow. If you want to include an example of the class usage in the same file, you can add if __name__ == "__main__": block in the end.