I'm trying to make a program that deleted all vowels from a string but for some reason it is not working. Here is my code in python 3
s = list(input())
vowels = ["A", "E", "I", "O", "U", "Y", "a", "e", "i", "o", "u", "y"]
for i in s:
if i in vowels:
s.remove(i)
The code works except for when two vowels are adjacent to each other since it skips and iteration. Please let me know if any of you have any ideas on how I could solve this small issue, thanks!