Skip to content

Commit e76db4f

Browse files
authored
Merge pull request #4 from CodingTutorials/Mosrod-patch-3
Added more examples and added a place for functions
2 parents 14cfa44 + 8dc6969 commit e76db4f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

Tutorials/Strings.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,21 @@
1616

1717
# Invalid: "he said "welcome!""
1818
message = 'he said "welcome!"' # Correct
19+
20+
# You can also use the backslash character to ignore quotes
21+
message = 'mary\'s ice cream'
22+
message = "she exclaimed \"good\" morning"
23+
24+
# Use three double quotes for a multiline string
25+
message = """ hello
26+
line1
27+
line2
28+
line3
29+
...
30+
"""
31+
print(message)
32+
33+
# Different avaliable functions for strings
34+
35+
# | Length |
36+
a = len("hello") # a = 5

0 commit comments

Comments
 (0)