python single and double quotation marks, and three marks mix

apostrophe:

  1. When a single quotation mark in single quotes, requires the use of single quotes inside an escape character, or else will be given;
  2. When there is a single double quotation marks, the double quotation marks without an escape character, the default character as an ordinary double quotes, and vice versa.

Double quotes:

  1. When present in double quotes double quotes, requires the use of the internal double quotes escape character, or else will be given;
  2. When there is a single double quotation marks, the single quotation marks can not an escape character, the default single quote is an ordinary character, and vice versa;

Three single and three pairs of quotation marks:

  1. Three single and double quotes three ships for multi-line comments, and the original string holding the output format of the output print;
  2. Three single and three pairs of quotation marks are not contain each other, and contains its own, with the escape character does not work;
  3. Three three single and double quotes and can contain single and double quotes, and the default single and double quotes is an ordinary character;
  4. Single and double quotes are not contain three single and three double quotes.

 

Reference documents: https://blog.csdn.net/PFzcnds8310__/article/details/100522636

 

Guess you like

Origin www.cnblogs.com/sunshine-blog/p/11959263.html