Program using re module that loops through the lines of a file or standard input where each line contains a single word and prints all words containing two adjacent vowels

0 votes

There is a list with ["eye", "ear", "waist", "neck"]

My output should be "ear" and "waist", since these words have two adjacent vowels in them.
Nov 24, 2020 in Python by S
• 120 points

1 answer to this question.

0 votes

Hey, @S,

you can have a look at the below given example:

s= "reading a book is great"

For both upper and lowercase vowels.


You could use [A-Za-z] instead of \w, if you don't want a digit or _ exists before or after the vowels. Because \w also matches _ and digits.


Add case-insensitive modifier (?i) or re.IGNORECASE to do a case-insensitive match.

answered Nov 24, 2020 by Gitika
• 65,930 points

Related Questions In Python

+2 votes
3 answers

Write a for loop that prints all elements of a list and their position in the list. a = [4,7,3,2,5,9]

Try using this question by list comprehension: a=[4,7,3,2,5,9] print([x for ...READ MORE

answered Dec 8, 2019 in Python by vinaykumar
• 180 points
+1 vote
1 answer
+1 vote
0 answers

Sum the values of column matching and not matching from a .txt file and write output to a two different files using Python

Name                                                    value DR_CNDAOFSZAPZP_GPFS_VOL.0 139264 DR_CNDAOFSZAPZP_GPFS_VOL.1 15657 DR_CNDAOFSZAPZP_GPFS_VOL.0 139264 DR_CNDAOFSZAPZP_GPFS_VOL.1 156579 DR_CNDAOFSZAPZP_GPFS_VOL.2 156579 DR_CNDAOFSZAPZP_GPFS_VOL.3 ...READ MORE

Nov 20, 2019 in Python by Sagar
• 130 points
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 2,250 views
0 votes
0 answers
+5 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
0 votes
1 answer