Chapter 18 - Concept Summary¶
Chapter 18 included the following concepts from computing.
- Comment - A comment in Python starts with a
#and the computer will ignore everything from that character to the end of that line. Comments are used to explain your code to people.
Summary of Python Keywords and Functions¶
- Close - The
closeprocedure closes a file after you are done processing it. - Find - The
findfunction is used like thisstrName.find(test). It returns the index oftestinstrNameif it is found and -1 if it is not found. - Open - The
openprocedure opens the passed file for either reading or writing. - Split - The
splitfunction returns a list of strings separated by a specified character. For example, ifmessage = "Nora, Jones, 15"thenmessage.split(",")would return['Nora', 'Jones', '15'].