I am trying to make a function to detect how many digits, letter, spaces, and others for a string.
Here\'s what I have so far:
def count(x): leng
def match_string(words): nums = 0 letter = 0 other = 0 for i in words : if i.isalpha(): letter+=1 elif i.isdigit(): nums+=1 else: other+=1 return nums,letter,other x = match_string("Hello World") print(x) >>> (0, 10, 2) >>>