0

Does this code seems good or it can be improve (without any library)?
Elements swapping of a list with its neighboring element
alist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
lenofalist = len(alist)
index = 0
temp = 0
while index < lenofalist:
temp = alist[index+1]
alist[index+1] = alist[ind...