Python之%s%d%f

%s 字符串python string="hello" #%s打印时结果是hello print "string=%s" % string # output: string=hello #%2s意思是字符串长度为2,当原字符串的长度超过2时,按原长度打印,因此%2s的打印结果仍是hello print "string=%2s" % string # o
相关文章
相关标签/搜索