Removing items for a list using a loop in Python

前端 未结 5 1205
深忆病人
深忆病人 2020-12-12 00:17

I am very new to programming in general and have started with Python. I am working through various problems to try and better my understanding.

I am trying to defin

5条回答
  •  醉酒成梦
    2020-12-12 00:56

    You can also do it succinctly with a comprehension:

    def anti_vowel(text):
        return ''.join(ch for ch in text if ch.upper() not in 'AEIOU')
    

提交回复
热议问题