-
-
Save amankharwal/0dac60f848ec8bbd9b1d39c4fce04f7d to your computer and use it in GitHub Desktop.
This file contains 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
def swap(list_, a, b): | |
list_[a], list_[b] = list_[b], list_[a] | |
names = ["Aman", "Kharwal", "Sajid", "Akanksha"] | |
print(names) | |
swap(names, 2, 3) | |
print(names) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment