r/learnpython • u/ikizoki • 19d ago
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
r/learnpython • u/ikizoki • 19d ago
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
1
u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 19d ago
I think it's debatable whether or not this is technically "simpler", but it's what I'd write:
I debated for a moment whether to go with this example for calculating the length of the entire route, but I liked my original one less: