anti_vowel# strange problem about usage of list--help


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/1/2?curriculum_id=4f89dab3d788890003000096
<In what way does your code behave incorrectly? Include ALL error messages.>
Traceback (most recent call last):
File “C:\Users\Pan\Documents\Python\anti_vowel.py”, line 9, in
anti_vowel(“Hey look Words!”)
File “C:\Users\Pan\Documents\Python\anti_vowel.py”, line 7, in anti_vowel
return “”.result
AttributeError: ‘str’ object has no attribute ‘result’
[Finished in 0.1s with exit code 1]
<What do you expect to happen instead?>
I use ‘result = ’ to creat a list, but the message shows that I created a str,I wonder that’s why?

```python

def anti_vowel(text):
l = list(text)
result =
for i in l:
if i not in “aeiouAEIOU”:
result.append(i)
return “”.result

anti_vowel(“Hey look Words!”)
#below this line is for test
a =
a.append(‘x’)
print type(a)
print a

<do not remove the three backticks above>

#2

sorry for that,the '.'option is for ‘str’,list has no attribute of ‘.’,transform list to str,you need to use ‘’.join(list)


#3

did you solved it by using join?


#4

yep,I made it! :slight_smile: