Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,939 questions

51,876 answers

573 users

How to remove the vowels from a string in Python

2 Answers

0 votes
def remove_vowels(s): 
    vowels = ('a', 'e', 'i', 'o', 'u')  
    for ch in s.lower(): 
        if ch in vowels: 
            s = s.replace(ch, "") 
              
    return s
  

s = "Python Programming"

print(remove_vowels(s)) 



'''
run:

Pythn Prgrmmng

'''

 



answered Jun 22, 2019 by avibootz
0 votes
import re

def remove_vowels(s): 
   return (re.sub("[aeiouAEIOU]", "", s))
   
s = "Python Java Rust Programming"
 
print(remove_vowels(s)) 
 
 
 
'''
run:
 
Pythn Jv Rst Prgrmmng

'''

 



answered Nov 21, 2022 by avibootz

Related questions

1 answer 113 views
1 answer 94 views
1 answer 111 views
111 views asked Nov 21, 2022 by avibootz
1 answer 110 views
110 views asked Nov 21, 2022 by avibootz
1 answer 104 views
1 answer 126 views
1 answer 92 views
...