Python Introducing Lists Using Lists Continental

Daron Anderson
Daron Anderson
1,970 Points

Still looking for a solution made some progress over the last few hours. psh Im not giving up :)

Im looking for the solution within the video, if it is in the video its just hard for me to grasp which is why I am asking for help/solution. Thank you!

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]
# Your code here
for continent in continents:
    print ("* " + continent)
continents += continent
for A in continents[0]:
    print (continent)

3 Answers

frozenaught
frozenaught
4,745 Points

Ahh, ok. Now i get it. Now i can see your thought process so i can give you some clues that will help.

so if you use your code that i mentioned above it should pass the first test. Then all you will need to do is add some conditional checking to it so it only prints out the ones that start with 'A' (remember to keep the * in front of the print out or it will fail you). so you would keep the 'for loop' and then check each item. Something like: If item[0] is equal to 'A' then print ' * ' + item. I hope this helps, im not sure how else to explain it without actually giving you the answer. Good luck, you got this!

frozenaught
frozenaught
4,745 Points

Hello Daron Anderson, it seems like you already have the correct answer. There is no need for all the code you have after your first print statement. The below snippet from your code will pass the challenge. good luck.

for continent in continents:
    print ("* " + continent) 
Daron Anderson
Daron Anderson
1,970 Points

speeddemon I actually meant for the 2nd part which is asking to print only the continents that start with A, my bad lol.