Python: Check whether a given string has a capital letter, a lower case letter, a number and specified length
Check string for capital, lower, number, length.
Write a Python program to check whether a given string contains a capital letter, a lower case letter, a number and a minimum length.
Sample Solution:
Python Code:
Sample Output:
Input the string: W3resource ['Valid string.']
Flowchart:
For more Practice: Solve these Related Problems:
- Write a Python program to validate that an input string contains at least one uppercase letter, one lowercase letter, one digit, and meets a minimum length requirement.
- Write a Python program to use regular expressions to verify that a string satisfies conditions for capital letters, lowercase letters, numbers, and length.
- Write a Python program to implement a function that returns a list of missing criteria if an input string fails to meet specified requirements.
- Write a Python program to prompt the user for a string and print "Valid string." only if all character type conditions are met.
Go to:
Previous: Write a Python program find the common values that appear in two given strings.
Next: Write a Python program to remove unwanted characters from a given string.
Python Code Editor:
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.