Skip to content

Commit 35f15cf

Browse files
authored
Create Swaplist
1 parent 775bfb0 commit 35f15cf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Swaplist

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#Day_10_swaplist
2+
def swapList(lst):
3+
size = len(lst)
4+
5+
t = lst[0]
6+
lst[0] = lst[size - 1]
7+
lst[size - 1] = t
8+
9+
return lst
10+
11+
lst = []
12+
x = int(input("Enter number of elements : "))
13+
for i in range(0, x):
14+
element = int(input())
15+
16+
lst.append(element)
17+
18+
print(lst)
19+
print(swapList(lst))

0 commit comments

Comments
 (0)