MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/PythonLearning/comments/1mvbdfg/day_1_second_program/n9upscs/?context=3
r/PythonLearning • u/Red_Priest0 • Aug 20 '25
20 comments sorted by
View all comments
1
My general recommendations for a beginner:
validate the input. You expect a number. Find a way to validate that you really get a number and return an error if not
Check out https://pep8.org
Check out f-strings - they're nice to use and good for you
Find out what `if __name__ == '__main__'` means and use it afterwards
converter3 is not a a good name
let your functionname and variable names speak. Most (not all) comments are trivial
find the way (refer to 2.) how comments are being done for functions in python :)
1
u/lokidev Aug 21 '25
My general recommendations for a beginner:
validate the input. You expect a number. Find a way to validate that you really get a number and return an error if not
Check out https://pep8.org
Check out f-strings - they're nice to use and good for you
Find out what `if __name__ == '__main__'` means and use it afterwards
converter3 is not a a good name
let your functionname and variable names speak. Most (not all) comments are trivial
find the way (refer to 2.) how comments are being done for functions in python :)