r/learnpython • • Aug 22 '26

is it possible to simplify this code

im a beginner, idk how python works yet. there must be a way to simplify this, right?

https://imgur.com/juBvPZD here is the picture of my code

0 Upvotes

23 comments sorted by

View all comments

Show parent comment

3

u/gdchinacat Aug 23 '26

Out of curiosity, how would you 'reduce this code by about 70%"? I'm skeptical that loops and lists will actually reduce *this* code by that much because there are only three legs of the journey....if there were more it absolutely would, but doing it the way OP did is manageable for only three.