import getpass
class UserRegistration(object):
def __init__(self):
pass
def register(self):
register = self.register
self.username_and_password = {}
username = raw_input("Choose Username> ")
password = getpass.getpass("Choose Password> ")
confirm_password = getpass.getpass("Confirm Password> ")
if password == confirm_password:
self.username_and_password[username] = password
else:
print "Passwords didn't match"
return register
go = UserRegistration()
go.register()
Simple program that prompts user for username and password
If the passwords don't match, I want it to restart the process and prompt the user to enter password again
At the moment, it prints the string but doesn't restart the process.
Any ideas?