1. الرئيسية
  2. /
  3. المدوّنة
  4. /
  5. Python Program to Swap Two Variables
بايثون

Python Program to Swap Two Variables

September 27, 2022 1 دقيقة قراءة 2,203
Python Program to Swap Two Variables
x = input('Enter the value of x: ') y = input('Enter the value of y: ')  # create a temporary variable and swap the values temp = x x = y y = temp  print('The value of x after swapping: {}'.format(x)) print('The value of y after swapping: {}'.format(y))
شارك المقال:
اقرأ أيضاً

مقالات ذات صلة