![features-Python-courses-python-exercises-python-oop](https://1.bp.blogspot.com/-T3BongcoJFo/X4CftQxVL8I/AAAAAAAAB5U/Lf59WgNyhGo2FdogKqxv0PIy_Ef7XDPdgCLcBGAsYHQ/s0/my-python-courses-python-exercises-with-solutions.png)
Exercie 73
Write a python algorithm which delete all vowels from a given string s. Example if s = "Python is hight level programming language", the algorithm returns the string: "Pthn s hght lvl prgrmmng lngg"
Solution
def deleteVowels(s):
# define the liste of vowels
vowels = ['a','e','y','u','i','o']
# initializing the string without vowels
s1 = ""
# iterate over all characters in the string s
for x in s:
if x not in vowels:
s1 = s1 + x
return s1
# Example
s = "Python is hight level programming language"
print(deleteVowels(s))
# display: Pthn s hght lvl prgrmmng lngg
Younes Derfoufi
my-courses.net
my-courses.net