Quick actions

cmd+k|ctrl+k

Navigation

Languages

Bài 3

Snippet info

Language

Python

Visibility

public

Author

mr2uang55

Created

2016-10-16T17:04:15Z

Updated

2016-10-16T18:38:35Z

#Khoi tao nguyen am trong list tieng anh :D
vowels  = 'ueoai'
consonants = 'bcdfghjklmnpqrstvwxyz'
#Khoi tao string bat ki
s = 'Hello anh Long cao to, dep trai, tai gioi.'
#Thiet lap vong lap for de tinh nguyen am, phu am:
s = s.lower()
nguyenam = 0
phuam = 0
for word in s:
    if(word in vowels):
        nguyenam +=1
    if(word in consonants):
        phuam +=1
        
print("So nguyen am la: {0} \nSo phu am la: {1}".format(nguyenam, phuam))
        
INFO