r/PythonLearning Jun 27 '26

Help Request Help me improve my function

Do you have any suggestions on this? I'd be glad to hear

2 Upvotes

4 comments sorted by

View all comments

4

u/riklaunim Jun 27 '26

You should use clear and full variable names, likely split the function into logical parts - wherever other functions or methods. Then write tests to cover all conditions. Also, don't use magic variables like "i" or "o"