Skip to content

Commit

Permalink
Merge pull request #1188 from FarhanDazzler/master
Browse files Browse the repository at this point in the history
added new code
  • Loading branch information
fineanmol authored Oct 25, 2021
2 parents ccc6538 + b8aa639 commit 0f5ceed
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Program's_Contributed_By_Contributors/Python_Programs/swap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
def swapList(newList):
size = len(newList)

# Swapping
temp = newList[0]
newList[0] = newList[size - 1]
newList[size - 1] = temp

return newList newList = [12, 35, 9, 56, 24]

print(swapList(newList))

OUTPUT:-
[24, 35, 9, 56, 12]

0 comments on commit 0f5ceed

Please sign in to comment.