+ 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
8 Antworten
+ 2
for better' understanding just run my code one time...🙃
+ 2
@sayan
yes u r there once again with one line🤑😘
+ 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')
+ 1
@1of3
nice one
+ 1
@Ferhat
well
0
heres a python one liner###
enter a string
https://code.sololearn.com/cy25PSOSuhb2/?ref=app
0
that sounded cute😀😀😀😀