r/PythonLearning • • Aug 20 '25

Day 1 second program

Post image
77 Upvotes

20 comments sorted by

View all comments

1

u/lokidev Aug 21 '25

My general recommendations for a beginner:

  1. validate the input. You expect a number. Find a way to validate that you really get a number and return an error if not

  2. Check out https://pep8.org

  3. Check out f-strings - they're nice to use and good for you

  4. Find out what `if __name__ == '__main__'` means and use it afterwards

  5. converter3 is not a a good name

  6. let your functionname and variable names speak. Most (not all) comments are trivial

  7. find the way (refer to 2.) how comments are being done for functions in python :)