Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
beginner questions
#3
I would suggest you get back to the docs and read about isdigit(), islower() and isupper().
  • 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

Reply


Messages In This Thread
beginner questions - by Naito - Jan-18-2019, 10:46 AM
RE: beginner questions - by perfringo - Jan-18-2019, 11:13 AM
RE: beginner questions - by buran - Jan-18-2019, 11:14 AM
RE: beginner questions - by ODIS - Jan-18-2019, 11:15 AM
RE: beginner questions - by perfringo - Jan-18-2019, 11:49 AM
RE: beginner questions - by aakashjha001 - Jan-27-2019, 05:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner class. Need help with some questions. Willing to pay curtice 1 2,286 Mar-09-2018, 06:26 AM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020