r/badcode • • Apr 24 '21

python very efficient and scalable code

Post image
1.0k Upvotes

110 comments sorted by

View all comments

-51

u/NetherFX Apr 24 '21

Still pretty readable, and I can't quickly think of an improvement

5

u/Schlagbaum3000 Apr 24 '21

Maybe just one function taking a string? You can then create necessary functions with something like. You might then also create a list of functions from a list of possible tags.

chosetagDrama = lambda: chosetag('Drama')

Possibly move the selectedtags into a function parameter, too, to not rely on global variables.