I have this code. https://code.sololearn.com/cOqDxfao5JQx/?ref=app I want to make it valid if it consist atleast one Capital letter and 1 number. It works for AB1 but not for 1BA. Any idea ?
Your code checks for a letter followed by a digit. All you need to add is a check for a digit followed by a letter. To do that replace line 3 with the following: if re.search(r'([A-Z])+([0-9])+',password) or re.search(r'([0-9]+[A-Z]+', password):
It looks for your variables order, you searched letter+digit
With lookaround '(?=.*[A-Z])(?=.*[0-9])'
It's late but is it what you were looking for? https://code.sololearn.com/cy7Eqxm56q0Z/?ref=app
Dunaev Evgenii how to make it right if i want from both sides
Problem Statement Given two integers a and b, your task is to calculate and print the following four values:
Please help, any idea?