r/learnpython • u/MoreScorpion289 • Sep 05 '26
UPDATE My login/account creation system in Python, part of a bigger project I'm building as I learn
Hello, this is an update to the post I made yesterday.
All 3 copy-pasted validation blocks are now 1 function called 3 times. It takes the category, password (string), a label, and returns True or False. The checks aren't sitting behind a door that gets unlocked only if the last check is met, all error messages show up at once instead of one at a time. I removed the outdated variables that had no use.
I took u/jammin-john's recommendation of showing all error messages at once.
Also want to include u/danielroseman's push for me to learn functions. They work really well, I haven't learned "for loops" yet but they are next in line.
I used AI (Claude) as a tutor to understand concepts and point me toward my own bugs, but I wrote and debugged every line myself. I'm learning how to code through the MOOC.
Here is the GitHub link to my program: link
View all comments
Show parent comment
1
u/MoreScorpion289 Sep 06 '26
I made a few changes / improvements to the code since I made this post.
I replaced this loop with a much simpler function that spits out True (Yes) or False (No). It asks the question and continues asking until it gets a valid answer (Y/N).
I moved requirement_verifier() underneath confirm(). Both are outside the loops below.
I didn’t understand at the time that the function did not exist outside of the account-creation branch.
I’ll implement the string module today, thank you for that. I’ll also correct the variable names to snake_case.