# SWAPPING VALUES

## METHOD 1: ARITHMETIC METHOD

```
#!/usr/bin/env python3

def main() -> None:
    variableA = 3;
    variableB = 5;
    
    #before swap
    print("Before Swapping Values");
    print("Variable A: ", variableA);
    print("Variable B: ", variableB);
    
    #swapping the values of A & B
    print();
    print("After Swapping Values");
    variableA = variableA + variableB; #variableA becomes 8
    variableB = variableA - variableB; #variableB becomes 3
    variableA = variableA - variableB; #variableA becomes 5
    print("Variable A: ", variableA);
    print("Variable B: ", variableB);

if __name__ == "__main__":
    main();
    
 * OUTPUT
    Before Swapping Values
    Variable A:  3
    Variable B:  5

    After Swapping Values
    Variable A:  5
    Variable B:  3
```
