ITI 1120 Lecture Notes - Lecture 7: For Loop, Empty String, Substring

124 views3 pages

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 .

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