Python Introducing Lists Using Lists Continental

Question about Continents problem 2

continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] for i in continents: check=i if check[0]=="A": print(check)

Is this the correct Answers? It should be right because the system says that it cannot find Asia in my output. However, Asia is being outputted

continents.py
continents = [
    'Asia',
    'South America',
    'North America',
    'Africa',
    'Europe',
    'Antarctica',
    'Australia',
]
for i in continents:
 check=i
 if check[0]=="A":
   print(check)

2 Answers

Pedro Cabral
Pedro Cabral
20,282 Points

The problem is that you are not printing a bulleted list, you can see that in the error message: AssertionError: '* Asia' not found. You are missing the ul and the "asterisc space". Also keep in mind that the assignment check=i is redundant. You can use i straight away in your code and remove the check all together. Also keep in mind that the variable named i is usually used for numbers/counters, and a more descriptive name would be country. Lastly, you might be interested to know that there is a string method called startswith() that has the same effect as string[0] and is slightly more "readable".

Thank you for the answer, didn't realise that it asks me to have a bulleted list