fork download
  1. vocal = 0
  2. konsonan = 0
  3.  
  4. vowel = {'a', 'e', 'i', 'u', 'o'}
  5.  
  6. total_line = int(input())
  7.  
  8. for i in range(total_line):
  9. line = input()
  10. for char in line.lower():
  11. if char.isalpha():
  12. if char in vowel:
  13. vocal += 1
  14. else:
  15. konsonan += 1
  16.  
  17. print("Number of vowels: ", vocal)
  18. print("Number of consonants: ", konsonan)# your code goes here
Success #stdin #stdout 0.07s 14112KB
stdin
4
Once there was an elephant,
Who tried to use the telephant
No! No! I mean an elephone
Who tried to use the telephone
stdout
Number of vowels:  40
Number of consonants:  51