Full details of the stack pass through the python --XX- summary Summary

1、The start value of slice is less than then end value,and the step is negative

print("if the start value less then the end value and the step is negative ! "
      "No error will be reported and empty will be returned, ")
for i in range(0, 10, -1):
    print(i)

 

2、One line of code exchanges the value of a and b

# One line of code exchanges value of a and b
a = 1
b = 2
a, b = b, a
print(a, b)

 

Guess you like

Origin www.cnblogs.com/zxw-xxcsl/p/11479201.html