#!/usr/bin/python3 # -*- coding: utf-8 -*- # %% String literals # Strings are created with " or ' "This is a string." "This is also a string." # Strings can be added too! "Hello " + "world!" # => "Hello world!" # String literals (but not variables) can be concatenated without using '+' "Hello " "world!" # => "Hello world!" # You can find the length of a string len("This is a string") # => 16 "Don't worry about apostrophes with double-quotes" 'Bob said, "do not worry about double-quotes with apostrophes"' 'I said: "If you want to quote in a double-quoted string" do this' # Multi-line strings: """ This is also a string literal """ ''' This is """ also a string literal '''