I made a ATM function program, I need help because I can't display my username(un) and password(pw) in my program the error is
NameError: name 'un' is not defined
I tried defining un in the first line, but the value does not change after the user has input their information.
#functions
def FWelcome():
print("WELCOME!")
print("Please Log-In to access ATM:")
return;
def FUsername():
while True:
un=input("\nEnter Username ( use only letters ):")
if un.isalpha():
break
else : #invalid
print ("Invalid Username. Use of symbols and/or numbers are not allowed.\n")
return;
def FPassword():
while True:
pw=input("Enter Password ( use only numbers ):")
if pw.isnumeric():
break
else : #invalid
print ("Invalid Password. Use of symbols and/or letters are not allowed.\n")
return;
#atm program
FWelcome()
#username
FUsername()
#password
FPassword()
print("\nHello! Your Username is ", un, " and your password is ",pw )