Created
January 20, 2013 20:06
-
-
Save beauvais/4581317 to your computer and use it in GitHub Desktop.
anti_vowel for code academy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def anti_vowel(text): | |
| vowels = ["A", "a", "E", "e", "I", "i", "O", "o", "U", "u"] | |
| anti = [] | |
| for i in text: | |
| if i in vowels: | |
| pass | |
| else: | |
| anti.append(i) | |
| return "".join(anti) | |
| print anti_vowel("and i Like apricots") |
Another way ^^
def anti_vowel(text):
without_vowel = str()
vowel = "aeiouAEIOU"
for i in text:
if i not in vowel:
without_vowel += i
return without_vowel
Very nice guys
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is worked, too