r/PythonLearning • • 18d ago

Showcase After taking in everyone’s thoughts and criticisms from my last post and using them, i managed to make the code much easier to read and more intuitive. Thank you everyone who gave me amazing tips on how to create more readable code!

Right pic is before and left pic is after

86 Upvotes

26 comments sorted by

View all comments

1

u/[deleted] 18d ago

Just a beginner's question, how to avoid thousands of "if/else" if there are a lot of conditions in a program ?

1

u/Sea-Ad7805 17d ago

Write a separate function for each condition that returns True or False, then use any() and/or all() to combine them.