- 1
How can i solve this q with python
you are going to write a program that takes a string and checks if it contains consecutive vowels or not. It should give Positive as an output if it contains consecutive vowels and Negative otherwise. For example saetqi string contains a adjacent to e, which means that it contains consecutive vowels. So it should give Positive as an output. On the other hand, if you take the string of statoqag, the output should be Negative.
2 Respostas
- 1
create a list of vowels ,
Initialize a variable count with value 0,
Then iterate over the string and check for each letter to see if it is in list of vowels ,if it is,then increment the count else initialize count with value 0 again ,when the iteration is over ,check to see if count is greater than or equal to 2 ,if it is return a positive value else negative
0
Could you pls write sample code?