Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introducing Lists Using Lists Continental

Callum Anderson
seal-mask
.a{fill-rule:evenodd;}techdegree
Callum Anderson
Data Analysis Techdegree Student 10,200 Points

Trying to add bullet points (*) to list using finction the in loop function

I'm unsure what to add as in the preview it's showing the code perfectly like the challenge asks me to do but coming up with an error about my first listing (asia) saying it cannot be found but clearly in preview is there with the function in use

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]

for continent in continents:
    print("*" + continent)
Callum Anderson
seal-mask
.a{fill-rule:evenodd;}techdegree
Callum Anderson
Data Analysis Techdegree Student 10,200 Points

Nevermind I got it haha! Anyone looking at this post also wondering you add a space to the asterisk line, like this.

print("* " + continent) not sure why as no need to add space when following along from previous video but hope this helps!

1 Answer

Steven Parker
Steven Parker
231,248 Points

Adding a space prevents the "bullet" from running up against the word (and conforms to the model the instructions asked you to follow).

Another way to get proper spacing is to include the bullet as a separate argument:

    print("*", continent)