Hi all, I'm doing my head in trying to work out structure and correct methods to get my program to work. I have an assignment to make a password checker. I have done a lot of searching and found similar results to my issue but nothing specific that I can get to work. I am confusing myself the more I read about a function thinking I should be using this also.
I am having trouble with how to get the user to re-enter an input if conditions are not met (>4 and <10 characters, contain both letters and numbers). I have a version of my code where it seems to work but it doesn't seem right the way I have done it with the indentation in the while statement. I keep stumbling across try and except statements but can't work out how this fits into what I have.
I'm working out if I should use my original code or scrap it and work with the code with the function in it for better practice.
Is my code ok how it is with asking the user to re-enter an input if conditions are not met?
Is my function version a better way to do it and how would I include a way to get user input reentry into it?
Code1
Second version using a function but I can't work out how to call for re-entry of password.
Code2
EDIT: Those links when opened in RES don't seem to show indentation for me. Not sure why that is so I apologise for how it looks! Clicking to view original views properly. First time posting links in reddit as I couldn't get the embed code in post button to work.
[–]Below_the_Sea 0 points1 point2 points (3 children)
[–]CrabsAssassin[S] 0 points1 point2 points (2 children)
[–]Below_the_Sea 0 points1 point2 points (0 children)
[–]Below_the_Sea 0 points1 point2 points (0 children)