8 kinds of connection string Python

Based on this article Python3.6 version.

  1. A plus sign (str1 + str2), str result type.
    Here Insert Picture Description
  2. Comma connection (str1, str2), the result is tuple type.
    Here Insert Picture Description
  3. Formatting (%), as a result of type str.
    Here Insert Picture Description
  4. Format (format), the result is the type str.
    Here Insert Picture Description
  5. No spaces (spaces) is automatically connected, as a result of type str.
    Here Insert Picture Description
    NOTE: The parameter can not replace a particular string, as follows:
    Here Insert Picture Description
  6. Backslash multi-line connection (\), the result is str type.
    Here Insert Picture Description
  7. Multiplication connector (*), the result is the type str.
    Here Insert Picture Description
  8. join connection (join connect list / tuple type), the result is the type str.
    Here Insert Picture Description
  9. List comprehension, results str type.
    Here Insert Picture Description
Published 21 original articles · won praise 6 · views 8007

Guess you like

Origin blog.csdn.net/weixin_42128329/article/details/103446011