Python的字符串格式化有两种方式: 百分号方式.format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存.[PEP-3101] This PEP proposes a new system for built-in string formatting operations, intended as a replacement for the existing '%' string formatting operator. 1.百分号…
from keyword import kwlistprint(kwlist)for i in kwlist: print(i) 可以显示所有的关键字符,开发者不要重新赋予其他值. a = 10000b = 10000print(id(a))print(id(b))>>57856560>>57856560 在python中两个变量的值相同时,指向同一值的地址. a = 5b = aprint(id(a))print(id(b))a = 10print(id(a))print(id(…