当前位置:网站首页>Example 047: Functions Swap Variables

Example 047: Functions Swap Variables

2022-08-10 03:32:00 lazily

Title: The values ​​of two variables are interchanged using a function.

Program Analysis:None

I. Code

def exc(a, b):return (b, a)a = 0b = 10a, b = exc(a, b)print(a, b)

Second, the effect

  ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓LazyXiaofan sincerely invites you to click below to learn and discuss together↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

原网站

版权声明
本文为[lazily]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208100201343339.html