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
close
procedure closes a file after you are done processing it. - Find - The
find
function is used like thisstrName.find(test)
. It returns the index oftest
instrName
if it is found and -1 if it is not found. - Open - The
open
procedure opens the passed file for either reading or writing. - Split - The
split
function returns a list of strings separated by a specified character. For example, ifmessage = "Nora, Jones, 15"
thenmessage.split(",")
would return['Nora', 'Jones', '15']
.