# Help with flipping the rows instead of columns

**URL:** <https://forum.freecodecamp.org/t/help-with-flipping-the-rows-instead-of-columns/373770>\
**Category:** I Built This\
**Created:** [April 15, 2020, 7:42pm UTC](https://forum.freecodecamp.org/t/help-with-flipping-the-rows-instead-of-columns/373770 "2020-04-15T19:42:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![csquare121](https://avatars.discourse-cdn.com/v4/letter/c/a8b319/32.png) [@csquare121](https://forum.freecodecamp.org/u/csquare121)\
**Post date:** [April 15, 2020, 7:42pm UTC](https://forum.freecodecamp.org/t/help-with-flipping-the-rows-instead-of-columns/373770/1 "2020-04-15T19:42:54Z")

</div>

Where is the part of this code that flips the columns and how do I replace it with the logic that flips rows instead?

```auto
def flipIt(array):
    for i in range(len(array)):
        length = len(array[i])
        for j in range(length // 2):
            temp = array[i][j]
            array[i][j] = array[i][length - 1 - j]
            array[i][length - 1 - j] = temp

```

---

<div class="post-metadata">

**Author:** ![JeremyLT](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jeremylt/32/291894_2.png) [@JeremyLT](https://forum.freecodecamp.org/u/JeremyLT)\
**Post date:** [April 15, 2020, 7:43pm UTC](https://forum.freecodecamp.org/t/help-with-flipping-the-rows-instead-of-columns/373770/2 "2020-04-15T19:43:19Z")

</div>

You already have a topic discussing this.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [April 15, 2020, 7:44pm UTC](https://forum.freecodecamp.org/t/help-with-flipping-the-rows-instead-of-columns/373770/3 "2020-04-15T19:44:35Z")

</div>

Unlisted on April 15, 2020, 7:44pm UTC



---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [April 15, 2020, 7:44pm UTC](https://forum.freecodecamp.org/t/help-with-flipping-the-rows-instead-of-columns/373770/4 "2020-04-15T19:44:50Z")

</div>

Please do not create duplicate topics. I have closed this thread.

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [April 15, 2020, 7:44pm UTC](https://forum.freecodecamp.org/t/help-with-flipping-the-rows-instead-of-columns/373770/5 "2020-04-15T19:44:52Z")

</div>

Closed on April 15, 2020, 7:44pm UTC


