# Remove Vowels from a String in Python

PythonServer Side ProgrammingProgramming

Suppose we have a string, we have to remove all vowels from that string. So if the string is like “iloveprogramming”, then after removing vowels, the result will be − "lvprgrmmng"

To solve this, we will follow these steps −

• create one array vowel, that is holding [a,e,i,o,u]
• for v in a vowel
• replace v using blank string

## Example

Let us see the following implementation to get a better understanding −

Live Demo

class Solution(object):
def removeVowels(self, s):
s = s.replace("a","")
s = s.replace("e","")
s = s.replace("i","")
s = s.replace("o","")
s = s.replace("u","")
return s
ob1 = Solution()
print(ob1.removeVowels("iloveprogramming"))

## Input

"iloveprogramming"

## Output

lvprgrmmng
Published on 27-Feb-2020 11:39:21
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.24234305322170258, "perplexity": 8464.51801992705}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991812.46/warc/CC-MAIN-20210515004936-20210515034936-00327.warc.gz"}