Python Regular Expression Practice Quiz "Authentication!"
Hey there, I have some Problems at the Python Practice Quiz "Authentication!" the input is a Password which shall has -at least one uppercase character and at least one number I got some help from google to solve it and surprisingly I really passed this Quiz but the Code is not right and I have no Idea how to change it, that it works in the right way. The Problem is: the most Password inputs are recognized correctly (see Examples below) but for example the Password "aA1" which also contains a uppercase character and one number, it shows "wrong format". Thanks for your Help my Code: import re password = input() pattern = r"\d.*[A-Z]|[A-Z].*\d" if re.match(pattern, password): print("Password created") else: print("Wrong format") Example Inputs -> Outputs: Aa1 ->Password created A1a ->Password created 1Aa ->Password created 1aA ->Password created aA1 ->Wrong format -->should be "Password created" a1A ->Wrong format -->should be "Password created"