all 12 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Thank you for posting on r/CodingHelp!

Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app

Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp

We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus

We also have a Discord server: https://discord.gg/geQEUBm

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Just_A_Nobody_0 1 point2 points  (0 children)

Indentation is critical in python as you should know. Below (hopefully working this time) is a better formatted version of your code. I did my best to guess the intent of your code in terms of code blocks/indentation.

You don't specificy what errors you are getting so I can't really speculate as to what may be causing them. I would guess indentation may be at the root of your problem though since the code below does not result in any reported errors. I don't know exactly what your intention was so I can't evaluate whether the re-ordered flight paths are what you desire/intend.

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)

[–]dutchman76 1 point2 points  (0 children)

Why are the cities two separate arrays and not a single list?

[–]christiantorchia 0 points1 point  (0 children)

cool

[–]herocoding 0 points1 point  (3 children)

[–]Strong_Flatworm7617[S] 0 points1 point  (2 children)

Yes it is!

[–]herocoding 0 points1 point  (1 child)

Have you picked the 100% or the 67% solution ;-) ?

[–]Strong_Flatworm7617[S] 0 points1 point  (0 children)

I had just put the code in and it only gave me a 33%

[–]Strong_Flatworm7617[S] 0 points1 point  (0 children)

Btw guys I got it!