- 3

Password 🔑 validation

Sample Input: 2 Geek GfG1 Sample Output: NO YES Explanation: Test Case 1: It does not contain any numerical character. Test Case 2: The password is valid. For each test case ,print yes or no in a new line. To print 'Yes' Condition: password must contain one Upper and one lower case letter also a numerical character.

5th Mar 2022, 10:07 AM
Ravi Teja
Ravi Teja - avatar
11 ответов
+ 4
Ravi Teja Show whatever you have tried so we can where you are doing mistake.
5th Mar 2022, 12:42 PM
A͢J
A͢J - avatar
+ 3
Mention language and show attempts
5th Mar 2022, 10:17 AM
A͢J
A͢J - avatar
+ 1
n=int(input()) for i in range(n); str=input() if str.lower and str.upper in str: print("Yes") else: print("No")
5th Mar 2022, 12:56 PM
Ravi Teja
Ravi Teja - avatar
+ 1
Ravi Teja You can count uppercase, lowercase, number using isupper(), islower(), isdigit() function After counting check if all are greater than or equal to 1 like this string = input() c1 = 0 c2 = 0 c3 = 0 for i in string: if i.islower(): c1 += 1 elif i.isupper(): c2 += 1 elif i.isdigit(): c3 += 1 if c1 >= 1 and c2 >= 1 and c3 >= 1: print ("YES") else: print ("NO")
5th Mar 2022, 2:45 PM
A͢J
A͢J - avatar
6th Mar 2022, 5:19 AM
Cassandra Rubens
5th Mar 2022, 10:19 AM
Ravi Teja
Ravi Teja - avatar
0
No of attempts
5th Mar 2022, 10:20 AM
Ravi Teja
Ravi Teja - avatar
0
I tried a lot in many ways as much as I can but no result
5th Mar 2022, 12:41 PM
Ravi Teja
Ravi Teja - avatar
0
I did every thing in compiler correctly,above all did dude
5th Mar 2022, 1:06 PM
Ravi Teja
Ravi Teja - avatar
0
The code is also running successfully but,test cases not coming
5th Mar 2022, 1:07 PM
Ravi Teja
Ravi Teja - avatar
0
When i did submit its showing wrong
5th Mar 2022, 1:07 PM
Ravi Teja
Ravi Teja - avatar