Skip to content

Commit 86fb744

Browse files
authored
Updated Python string tutorial documentation
1 parent 89d0bde commit 86fb744

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Tutorials/Strings.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,17 @@
22

33
# Print welcome message
44
print("Hello World")
5+
6+
# Strings can either be surrounded in " or '
7+
print('Hello World')
8+
9+
# You can use variables to store strings, then print them out
10+
message = "Hello World"
11+
print(message)
12+
13+
# If you want to put single quotes in a single quote string or double quotes in a double quote string, you need to change the string's quote type
14+
# Invalid: 'hello's world'
15+
message = "hello's world" # Correct
16+
17+
# Invalid: "he said "welcome!""
18+
message = 'he said "welcome!"' # Correct

0 commit comments

Comments
 (0)