NOTE: This is only a sample of the code, and it won't show tabs.
uy = None
username = input("What is your username?\n\t")
uy = input("Username is " + username + ". Is this true? (y/n)")
if uy == "y":
elif uy == "n":
#This is where I want it
password = getpass.getpass("What is your password?\n\t")
cp = getpass.getpass("Confirm your password:\n\t")
if cp == password:
#This is also where I want it
What you really want to do is restructure your logic just a bit especially in the first part where you want to start over. Instead of saying:
if uy == "y": continue elif uy == "n":
Do something like:
if uy == "n": login() elif uy == "y": #continue on with the rest of the password code
And then in the bottom of the script you could just call
login() again to restart the process.
If this helped solve your problem, please consider upvoting and marking my answer as the accepted answer to close this question. I will continue to answer any questions you might have.