From 6ae508dfc6a7bd4449dad2578e1ec4aa1661ec99 Mon Sep 17 00:00:00 2001 From: Lala Ibadullayeva <86626835+Lala2398@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:29:36 +0400 Subject: [PATCH] Add files via upload --- .../Python_Other Solution/String_Validators.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Python Badge Solutions/Python_Other Solution/String_Validators.py diff --git a/Python Badge Solutions/Python_Other Solution/String_Validators.py b/Python Badge Solutions/Python_Other Solution/String_Validators.py new file mode 100644 index 0000000..99384ef --- /dev/null +++ b/Python Badge Solutions/Python_Other Solution/String_Validators.py @@ -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) + +