ITI 1120 Chapter Notes - Chapter 3: Empty String, Escape Character, Newline

69 views2 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents