+ 1
How can we count the vowels in a given sentence?
I'm still in the foundations of coding(6 lessons in) How can u call out a data[vowels] to count the vowels in a sentence? Can I use def() and return function for this to run and for it to display?
1 Answer
+ 2
Zecheesecake ,
can you link your current code here?
in general:
to count the total number of all vowels in a string, we can try this:
> define the vowels as a string
> create a counter variable
> iterate over the input string
> if the current character is in the `vowels `
> increment counter
> finally output the value of the counter