Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """In the first line, print True if has any alphanumeric characters. Otherwise, print False.
- In the second line, print True if has any alphabetical characters. Otherwise, print False.
- In the third line, print True if has any digits. Otherwise, print False.
- In the fourth line, print True if has any lowercase characters. Otherwise, print False.
- In the fifth line, print True if has any uppercase characters. Otherwise, print False."""
- s = "6 omega DOCTOR ##me 12 %$@"
- alphanumeric = False
- alphabetical = False
- digits = False
- lowercase = False
- uppercase = False
- for l in s:
- if l.isalpha():
- alphabetical = True
- elif l.isdigit():
- digits = True
- elif l.isalnum():
- alphanumeric = True
- elif l.islower():
- lowercase = True
- elif l.isupper():
- uppercase = True
- else:
- pass
- print(alphanumeric)
- print(alphabetical)
- print(digits)
- print(lowercase)
- print(uppercase)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement