You can use tuple unpacking. Tuple unpacking allows you to avoid the use of a temporary variable in your code (in actual fact I believe the Python code itself uses a temp variable behind the scenes but it's at a much lower level and so is much faster).
input_seq[ix1], input_seq[ix2] = input_seq[ix2], input_seq[ix1]
I have flagged this question as a duplicate, the answer in the dupe post has a lot more detail.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…