18.9. 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.
18.9.1. 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']
.
Note
This is the end of chapter 18. We would love it if you could give us some feedback on this chapter at https://www.surveymonkey.com/r/ch18-student-fb. You might want to open this link in a new tab to make it easier for you to return to your place in this ebook.