Skip to content

Instantly share code, notes, and snippets.

@syedjafer
Created April 28, 2021 11:07
Show Gist options
  • Select an option

  • Save syedjafer/9b47523ef520aeec577b90d6f223ef65 to your computer and use it in GitHub Desktop.

Select an option

Save syedjafer/9b47523ef520aeec577b90d6f223ef65 to your computer and use it in GitHub Desktop.
nums = [1, 2, 3, 4, 5]
total_nums = len(nums)
for itr in range(total_nums//2):
temp = nums[itr]
nums[itr] = nums[total_nums-itr-1]
nums[total_nums-itr-1] = temp
print(nums)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment