OSDN Git Service

Regular updates
[twpd/master.git] / python.md
index 0ef2df6..f885717 100644 (file)
--- a/python.md
+++ b/python.md
@@ -73,6 +73,18 @@ category: Python
     str.strip()
 
     str.islower()
+    
+    /* escape characters */
+    >>> 'doesn\'t'  # use \' to escape the single quote...
+        "doesn't"
+    >>> "doesn't"  # ...or use double quotes instead
+        "doesn't"
+    >>> '"Yes," they said.'
+        '"Yes," they said.'
+    >>> "\"Yes,\" they said."
+        '"Yes," they said.'
+    >>> '"Isn\'t," they said.'
+        '"Isn\'t," they said.'
 
 ### Casting