From 01c0295dfbb5567b9a828c5c50597977f6726f37 Mon Sep 17 00:00:00 2001 From: Farhan Dazzler <41571102+FarhanDazzler@users.noreply.github.com> Date: Sun, 24 Oct 2021 19:12:18 +0530 Subject: [PATCH 1/2] added new code --- .../Python_Programs/swap.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Program's_Contributed_By_Contributors/Python_Programs/swap.py diff --git a/Program's_Contributed_By_Contributors/Python_Programs/swap.py b/Program's_Contributed_By_Contributors/Python_Programs/swap.py new file mode 100644 index 0000000000..c757535386 --- /dev/null +++ b/Program's_Contributed_By_Contributors/Python_Programs/swap.py @@ -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] \ No newline at end of file From b8aa639d8f14ebf87a88301cd7cb01c487b1fd3d Mon Sep 17 00:00:00 2001 From: Farhan Dazzler <41571102+FarhanDazzler@users.noreply.github.com> Date: Sun, 24 Oct 2021 19:18:41 +0530 Subject: [PATCH 2/2] added new code.