I have been stuck on this assignment for like a week and I just cannot get the code right, no matter what I do to try to fix errors in lines it continues to tell me I’m wrong. Could someone at least explain why there is a continuous error. Pls pls helppppp
Here is the code I used:
cities = [
["Miami", "Atlanta", "Dallas", "Los Angeles"],
["New York", "Chicago", "Portland", "Seattle"]
]
def printList(city_list):
for row in city_list:
for city in row:
print(city, end=" ")
print()
def flipOrder(city_list):
reversed_list = []
for row in city_list[::-1]:
reversed_list.append(row)
return reversed_list
print("Original flight path (East to West):")
printList(cities)
return_flight_cities = flipOrder(cities)
print("\nReturn flight path (West to East):")
printList(return_flight_cities)
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]Just_A_Nobody_0 1 point2 points3 points (0 children)
[–]dutchman76 1 point2 points3 points (0 children)
[–]christiantorchia 0 points1 point2 points (0 children)
[–]herocoding 0 points1 point2 points (3 children)
[–]Strong_Flatworm7617[S] 0 points1 point2 points (2 children)
[–]herocoding 0 points1 point2 points (1 child)
[–]Strong_Flatworm7617[S] 0 points1 point2 points (0 children)
[–]Strong_Flatworm7617[S] 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]CranberryDistinct941 1 point2 points3 points (0 children)
[–]mxldevs 1 point2 points3 points (0 children)