From 8dc6969d29219976a8bd39bf42b6f054115d4d33 Mon Sep 17 00:00:00 2001 From: Nathan R Date: Tue, 1 Oct 2019 14:55:38 -0400 Subject: [PATCH] Added more examples and added a place for functions --- Tutorials/Strings.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tutorials/Strings.py b/Tutorials/Strings.py index 70198c9..e84e684 100644 --- a/Tutorials/Strings.py +++ b/Tutorials/Strings.py @@ -16,3 +16,21 @@ # Invalid: "he said "welcome!"" message = 'he said "welcome!"' # Correct + +# You can also use the backslash character to ignore quotes +message = 'mary\'s ice cream' +message = "she exclaimed \"good\" morning" + +# Use three double quotes for a multiline string +message = """ hello +line1 +line2 +line3 +... +""" +print(message) + +# Different avaliable functions for strings + +# | Length | +a = len("hello") # a = 5