python基础题目100例之四十七 两个变量值互换 def exchange(a,b): a,b = b,a return (a,b) if __name__ =="__main__": x = int(input("输入第一个数值:")) y = int(input("输入第二个数值:")) print("x = %d,y = %d"%(x,y)) x,y = exchange(x,y) print("x = %d,y = %d"%(x,y))