The basic functions of python string 200308

Defined strings

  • By wrapping the string quotes
变量 = "内容"

String splicing

  • Character merger by addition
变量 = 字符串1 + 字符串2 + 字符串n

Formatted output string

  • The method of the formatting output format
变量 = "我的姓名是{},我的年龄是{}".format('张飞', 28)

String and integer conversion

  • Why do you want to convert
  • How to convert
Published 64 original articles · won praise 1 · views 816

Guess you like

Origin blog.csdn.net/whalecode/article/details/104733857
Recommended