# take inputs
      a = input('Enter the value of a: ')
      b = input('Enter the value of b: ')
      print('Values Before Swapping')
      print('a = ',a, 'and b = ',b)
      # create a temporary variable and swap the value
      temp = a
      a = b
      b = temp
      # display swapping values
      print('Values After Swapping')
      print('a = ',a, 'and b = ',b)
      

      Python language logo
      numSwapping

      beginner
      logic

      Program to swap two numbers

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.