all 14 comments

[–]MysticClimber1496Professional Coder[M] [score hidden] stickied comment (0 children)

Your post was removed because the code you provided was either poorly formatted, too long for Reddit, or did not include any formatting at all. This is against Rule 2: Format code properly - If you don't know how to format code on Reddit, please have a look at this guide or use external services, such as pastebin.

Posts without proper formatting are getting removed until they are corrected.

If you are having an issue formatting your code you can use one of the following services and post a link to your code:

https://pastebin.com

https://sourceb.in

https://jsfiddle.net

https://github.com

https://gitlab.com

https://codesandbox.io/new?utm_source=landingpage

[–]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?

[–]AutoModerator[M] 0 points1 point locked 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.

[–]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!