HELP! This code is killing me!

python_3

#1
import re
import time
verificationName=True
verificationAge=True
verificationYear=True

welcome=input("Would you like to create a new account?:")
if welcome=="yes":
    while verificationName==True:
        name=input("Please enter your name:")
        valid=re.match("[A-Z]",name)
        
        if valid:
            while verificationAge==True:
                verificationName=False
                age=input("Please enter your age:")
                validAge=re.match("[0-9]",age)
                print("OKIE")
        else:
            verificationName=True
            print("ERROR")
            
        if validAge:
            verificationAge=False
            while verificationYear==True:
                
                year=input("Please enter your year group:")
                validYear=re.match("[0-9]",year)
        else:
            verificationAge=True
            
        if validYear:
            print("Account complete!")

Why won’t it work?? I really need help!! On the age section it just keeps looping and won’t stop!


#2

You never change the value of verificationAge? here:

            while verificationAge==True:
                verificationName=False

seems to me you give the wrong variable a value of False


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.