🎲Count Vowels Value and position in String and Sum it🎲 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

🎲Count Vowels Value and position in String and Sum it🎲

develop a program ,in that the user enter a string. Your program counts the number of vowels in the text and prints it out. For added complexity, have it report a sum of each vowel(ASCII value & position) found in the string. example-1 input - Good vowel - o o position -2 3 asci - 111 111 ASCII Total = 222 Position Total= 5 example-2 input - Every vowel position ascii E 1 69 e 3 101 total 4 170 https://code.sololearn.com/c768FgO0PxfI/?ref=app

31st Oct 2017, 5:37 AM
Pranit Gandhi
Pranit Gandhi - avatar
8 Answers
+ 2
for better' understanding just run my code one time...🙃
31st Oct 2017, 5:37 AM
Pranit Gandhi
Pranit Gandhi - avatar
31st Oct 2017, 10:05 AM
Ferhat Sevim
Ferhat Sevim - avatar
+ 2
@sayan yes u r there once again with one line🤑😘
31st Oct 2017, 11:06 AM
Pranit Gandhi
Pranit Gandhi - avatar
+ 1
Scala val input = Console.readline("Enter word to count vowels") val output = input.count( "aeiou" contains _) println( output) If you want count vowels individually, use like val a = input.count(_ == 'a')
31st Oct 2017, 7:24 AM
1of3
1of3 - avatar
+ 1
@1of3 nice one
31st Oct 2017, 7:45 AM
Pranit Gandhi
Pranit Gandhi - avatar
+ 1
@Ferhat well
31st Oct 2017, 10:24 AM
Pranit Gandhi
Pranit Gandhi - avatar
0
heres a python one liner### enter a string https://code.sololearn.com/cy25PSOSuhb2/?ref=app
31st Oct 2017, 10:44 AM
sayan chandra
sayan chandra - avatar
0
that sounded cute😀😀😀😀
31st Oct 2017, 11:07 AM
sayan chandra
sayan chandra - avatar