christopher Junkins1,356 Points
Getting right output for indexing but not able to pass the question
I'm getting the right output but guessing its the not way they want. I guess they want me to use the continent[0,3,5,6] but not sure how to get a whole item from a list added and not just the first letter of the string.
continents = [ 'Asia', 'South America', 'North America', 'Africa', 'Europe', 'Antarctica', 'Australia', ] for continent in continents: if continent == "A": print("*" + continent)
James Joseph2,417 Points
If you want to remove an item from one list and put it in the other you can use pop.
separate = [continents.pop(0), continents.pop(2)]
Notice that I did 2 and not 3 on the second one. This is because it iterates through each one after each other. After I've poped out Asia, Africa would then take it's place in the index of 2.
More information on pop and other data structures: https://docs.python.org/3/tutorial/datastructures.html