CSE 1010 Lecture Notes - Lecture 3: Substring, Empty String
jadetortoise401 and 55 others unlocked
84
CSE 1010 Full Course Notes
Verified Note
84 documents
Document Summary
A string is a sequence of 0 or more characters delimited by single quotes or double quotes. Inside of any of the pairs of quotes, there are special character sequences, beginning with a backslash (\), which are interpreted in a special way. Inserting a \ in the middle of string tells python that the next character will have a special meaning. \n: end the current line of text and start a new one. : skip to the net tab stop in the text. Python provides what are called raw strings, in which the special characters have no special meaning. Raw strings are used by adding either r or r before the first quote. Concatenation: the addition operator + takes on the role of concatenation when used with strings. Repetition: a string can be repeated by the value of an integer with * operator. Indexing: strings can be indexed, with the first character having index 0.