Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # slovo=input("Введите слово: ")
- slovo = 'ясень'
- glas = ['а','у','о','ы','и','э','ю', 'е','ё','ю','я']
- double = ['е','ё','ю','я']
- sogl = ['б','в','г','д', 'ж','з','к', 'л','м','н','п','р','с','т','ф','х','ц','ч','ш','щ', 'й']
- without = ['ъ','ь']
- count=0
- for i in range(len(slovo)):
- if slovo[i] in glas or slovo[i] in sogl:
- count+=1
- if slovo[i] in double:
- if i == 0:
- count+=1
- if slovo[i] == slovo[i-1] and i != 0:
- count+=1
- if slovo[i-1] in glas and i != 0:
- count+=1
- if slovo[i-1] in without and i != 0:
- count+=1
- if slovo[i] in sogl:
- if slovo[i]==slovo[i-1] and i != 0:
- count-=1
- print(slovo[i], i, count)
- print ("Количество букв: ",len(slovo))
- print ("Количество звуков: ",count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement