ITI 1120 Lecture Notes - Lecture 7: For Loop, Empty String, Substring
Document Summary
Revisit strings: x in s - x is a substring of s x not in s. >true: because it compares it based on alphabetically order. All capitol letter are smaller than all lowercase letter, regardless of. "is there a letter e in the string s?"". ***doesnt not work, bc they have to be the same type type error. In vida : empty string, anything can be in an empty string. Bc it starts at 0, u have to minus 1 s[len(s) - 1] s[-(len(s))] first one. ***** across all programming languages, counting start at 0 not 1***** **** dir(str) - function that are built in with strings help(str. capitalize) S. capitalize() - does not change string, but returns a new string-capitalizes the first letter of the strong s. replace(septemebr, may) name=input( what is your name:) Name. strip() will remove white space in the beginning and in the end extra space e only, not in between the words name= xyxyxynaomiyxyx .