This is my code and it passed but I'm sure there's a better way to construct it. Any tips

def anti_vowel(text):
    words = list()
    for t in text:
        if t == 'A' or t == 'a' or t == 'E' or t=='e' or t=='I' or t=='i' or t=='O' or t=='o' or t=='U' or t=='u':
    word = ''.join(words)
    return word
    print word



I definitely would check if its a vowel with:

if t .lower() in "aeiou":


Nice result, but can not see a case statement. My solution used two loops ( extra one for checking vowels), yours is better.
It is nice to see somebody else who has stuck to the course material available to this point for a solution.


Hi! In short, it my option. Not so big as your, but may be somebody can do more interesting.....

def anti_vowel(text):
    a=["a", "e", "i", "o", "u", "A", "E", "I", "O", "U"]
    for i in a:
    return text


I wouldn't check lower and upper case by adding them all to the tuple.

def anti_vowel(text):
vowel = ["A", "E", "I", "O", "U"]
for l in text:
if l.upper() in vowel:
return text
print anti_vowel("Hello")


at the end i come with this, hope it helps!

def anti_vowel(text):
    novowel = ""
    for x in range(len(text)):
        if text[x] in "aeiouAEIOU":
            novowel += text[x]
    return novowel


def anti_vowel(text):
    vowels = ("a","e","i","o","u","A","E","I","O","U")
    for y in vowels:
        text = text.replace(y,"")
    return text


def anti_vowel(text):
for x in text:
if x.lower() in "aeiou":
text = text.replace(x, "")
return text`


def anti_vowel(text):
for i in text:
if i in "aeiouAEIOU":
return text


def anti_vowel(text):
string = ""
for char in text:
if char == char in 'aeiouAEIOU':
string += ""
string += char
return string

Simple code

Also, how do people make the gray blocks with indentations and everything for their code when posting it, pls help.


This is how you format code.


def anti_vowel(text):
for n in text:
if n not in vowel:
word+= n
return word


to make the grey go to create new topic, while there everything is already done for you, ie there is a place you paste your link, a place for your codes, expectations, errors etc...then you just post ...