Python Introducing Lists Using Lists Continental

Continental Can i get the answer for this

Can I get the answer for this how do i sort it for the ones that start with A's

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

1 Answer

Steven Parker
Steven Parker
203,753 Points

You can add an "if" statement to control when the "print" will run, and it can test the first character of the "items" to see if it is "A".

You can isolate a specific character of a string by indexing (a number in brackets after the variable name).

Still a little confused

Steven Parker
Steven Parker
203,753 Points

Try creating an "if" statement between the "for" and the "print" using the hints. Show the code you have at that point.