Created
April 28, 2021 11:07
-
-
Save syedjafer/9b47523ef520aeec577b90d6f223ef65 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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