Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Lala2398 authored Nov 27, 2024
1 parent 31ebed7 commit 6ae508d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Python Badge Solutions/Python_Other Solution/String_Validators.py
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)


0 comments on commit 6ae508d

Please sign in to comment.