Python从入门到放弃完整教程目录:https://www.cnblogs.com/nickchen121/p/10718112.html

a = 10
b = 10
c = 10
d = 10
print(f'a:{a}, b:{b}, c:{c}, d:{d}')
a:10, b:10, c:10, d:10
a = b = c = d = 10
print(f'a:{a}, b:{b}, c:{c}, d:{d}')
a:10, b:10, c:10, d:10

二、交叉赋值

x = 100
y = 200

temp = x
x = y
y = temp
print(f'x:{x}')
print(f'y:{y}')
x:200
y:100
x, y = y, x
print(f'x:{x}')
print(f'y:{y}')
x:100
y:200

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-11
  • 2021-06-09
  • 2021-04-12
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2021-05-14
相关资源
相似解决方案