ITI 1120 Chapter Notes - Chapter 3: Empty String, Escape Character, Newline
Document Summary
Single and double quotes are equivalent except for strings that contain quotes. The shortest string is the empty string, containing no characters at all. Len - returns the number of characters between the opening and closing quotes. We can add 2 strings using + operator. The concatenation operator mist be applied with 2 strings. If you want to join a string with a number, function str can be applied to the number to get a string representation of it, and then concatenation can be done: Four score and" + str(7) + years ago". >>>four score and 7 years ago: you can also multiply strings. Strings are values, so you can assign a string to a variable. Suppose you want to put a single quote inside a string - use double quotations to avoid error that may result from that"s, let"s, etc. If you need tp put a double quote in a string.