SyntaxFix
Write A Post
Hire A Developer
Questions
The simple Python swap looks like this:
foo[i], foo[j] = foo[j], foo[i]
Now all you need to do is figure what i is, and that can easily be done with index:
i
index
i = foo.index("password2")