python每次处理一个字符的三种方法 a_string = "abccdea" print 'the first' for c in a_string: print ord(c)+1 print "the second" result = [ord(c)+1 for c in a_string] print result print "the thrid" def do_something(c): return ord(c)+1 result
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(