escape characters for string

referenced string documentation here: https://docs.python.org/3.9/tutorial/introduction.html
This commit is contained in:
Nicholas Chen 2020-01-10 19:14:13 -05:00 committed by GitHub
parent bc51528f1a
commit e815651821
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

@ -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