#Title : Enter a line of characters and count the number of English letters, spaces, numbers and other characters in it. s = input( ' Please enter a string: ' ) alf = 0 space = 0 digi = 0 other = 0 for i in s: if i.isalpha(): alf += 1 elif i.isspace(): space += 1 elif i.isdigit(): digi += 1 else: other += 1 print ('alf = %s'% alf,'space = %s'% space ,'digi = %s'% digi, 'other = %s'%other)