2
Reply

How to create swapping program in Python

    There are three ways to create swapping program in python

    First

    1. a=5
    2. b=6
    3. temp=a
    4. a=b
    5. b=temp

    Second

    1. a=5
    2. b=6
    3. a=a+b
    4. b=a-b
    5. a=a-b

    Third

    1. a=5
    2. b=6
    3. (a,b)=(b,a)

    I din’t understand please elaborate more