-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
Python Badge Solutions/Python_Other Solution/String_Validators.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
if __name__ == '__main__': | ||
s = input() | ||
print(any(c.isalnum() for c in s)) | ||
print(any(c.isalpha() for c in s)) | ||
print(any(c.isdigit() for c in s)) | ||
print(any(c.islower() for c in s)) | ||
print(any(c.isupper() for c in s)) | ||
|
||
|
||
#any() for iteration. If we have any True so, our response is true. | ||
#for c in s - controling all elements | ||
#str.isalnum() - This method checks if all the characters of a string are alphanumeric (a-z, A-Z and 0-9) | ||
#str.isalpha() - This method checks if all the characters of a string are alphabetical (a-z and A-Z) | ||
#str.isdigit() - This method checks if all the characters of a string are digits (0-9) | ||
#str.islower() - This method checks if all the characters of a string are lowercase characters (a-z) | ||
#str.isupper() - This method checks if all the characters of a string are uppercase characters (A-Z) | ||
|
||
|