Skip to content

Commit 72f2143

Browse files
MattBlack85olasitarska
authored andcommitted
Add apostrophe in string example
1 parent 7c6c55d commit 72f2143

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

python_introduction/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@ You can also multiply strings with a number:
5555

5656
>>> "Ola" * 3
5757
'OlaOlaOla'
58+
59+
If you need to put an apostrophe inside your string, you have two ways to do it.
60+
61+
Using double quotes:
62+
63+
>>> "Runnin' down the hill"
64+
"Runnin' down the hill"
65+
66+
or escaping apostrophe with a backslash (`\`):
67+
68+
>>> 'Runnin\' down the hill'
69+
"Runnin' down the hill"
5870

5971
Nice, huh? To see your name in uppercase letters, simply type:
6072

0 commit comments

Comments
 (0)