Skip to content

Instantly share code, notes, and snippets.

Created October 15, 2017 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ee6ad3ba83777326b6e730363933639b to your computer and use it in GitHub Desktop.
Save anonymous/ee6ad3ba83777326b6e730363933639b to your computer and use it in GitHub Desktop.
def countMembers(s):
lower=["e","f","g","h","i","j"]
upper=["F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X"]
num=[2,4,5,6]
all_lists = lower + upper + list(str(num))
#as a one liner
total_count = len([character for character in s if character in all_lists])
#broken out
total_count = 0
for character in s:
if character in all_lists:
total_count += 1
print(total_count)
countMembers('aodfUuZha952')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment