From e815651821e4fc4b12353a3369092acb0ab3bc7c Mon Sep 17 00:00:00 2001 From: Nicholas Chen Date: Fri, 10 Jan 2020 19:14:13 -0500 Subject: [PATCH] escape characters for string referenced string documentation here: https://docs.python.org/3.9/tutorial/introduction.html --- python.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/python.md b/python.md index 0ef2df680..f885717b8 100644 --- 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