• 容易忘的小知识点记录_python
  • 字符串取前几位
    str='123456' print(str[0:3]) >>>123
  • strip()方法,去除字符串开头或者结尾的空格

a = " a b c "

a.strip()

'a b c'

  • python 全局变量
  • python int转string
a = 1
b = str(a) + ','


  • AWarning: Ignoring declarative-like tuple value of attribute user_level

解决: