Quick actions

cmd+k|ctrl+k

Navigation

Languages

exercise 3 - lab 2 - not for

Snippet info

Language

Python

Visibility

public

Author

hccc19

Created

2016-10-16T15:16:27Z

Updated

2016-10-16T15:18:14Z

# exercise 3 - lab 2
s = 'Counts English Vowels and Consonants'
s = s.lower()

print(s)

count_vowels = s.count('a') + s.count('o') + s.count('e') + s.count('i') \
+ s.count('u')

count_consonants = s.count('b') + s.count('c') + s.count('d') + s.count('f') \
+ s.count('g') + s.count('h') + s.count('j') + s.count('k') + s.count('l') \
+ s.count('m') + s.count('n') + s.count('p') + s.count('q') + s.count('r') \
+ s.count('s') + s.count('t') + + s.count('v') + s.count('w') \
+ s.count('x') + s.count('y') + s.count('z')

print("countVowels = %s countConsonants = %s" % (count_vowels, count_consonants))
INFO