Exchange variable values

Exchange variable values

There are two variables num1 = 10 and num2 = 20, how can do swap the values ​​of two variables?

Please implemented the program
the value of the two variables are exchanged.

Please write code in the right side of the editor, complete the exercise.

num1 = int(input())
num2 = int(input())

# 请不要修改源代码最上面2行
# 请在下面交换 num1, num2 两个变量的值
temp=num1
num1=num2
num2=temp
Published 74 original articles · won praise 25 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_43191251/article/details/104803911