Jan-18-2019, 11:14 AM
I would suggest you get back to the docs and read about isdigit(), islower() and isupper().
What you want to check is that at least one is digit, is lowercase or is uppercase
Look at any()
Also, you raise a general Exception. I would suggest to use more appropriate ValueError
- str.isdigit() - Return true if all characters in the string are digits and there is at least one character, false otherwise...
- str.islower() - Return true if all cased characters in the string are lowercase and there is at least one cased character, false otherwise.
- str.isupper() - Return true if all cased characters [4] in the string are uppercase and there is at least one cased character, false otherwise.
What you want to check is that at least one is digit, is lowercase or is uppercase
Look at any()
Also, you raise a general Exception. I would suggest to use more appropriate ValueError
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs