diff --git a/io.asciidoc b/io.asciidoc index 63ca688a..91683f2b 100644 --- a/io.asciidoc +++ b/io.asciidoc @@ -92,7 +92,7 @@ loop. This method returns a complete line including the newline character at the line. When an _empty_ string is returned, it means that we have reached the end of the file and we 'break' out of the loop. -In the end, we finally `close`the file. +In the end, we finally `close` the file. Now, check the contents of the `poem.txt` file to confirm that the program has indeed written to and read from that file. diff --git a/modules.asciidoc b/modules.asciidoc index 4e7244bb..5a9237c8 100644 --- a/modules.asciidoc +++ b/modules.asciidoc @@ -264,7 +264,7 @@ A note on `del` - this statement is used to *delete* a variable/name and after t run, in this case `del a`, you can no longer access the variable `a` - it is as if it never existed before at all. -Note that the `dir()` function works on *any* object. For example, run `dir('print')` to learn +Note that the `dir()` function works on *any* object. For example, run `dir(print)` to learn about the attributes of the print function, or `dir(str)` for the attributes of the str class. There is also a http://docs.python.org/2/library/functions.html#vars[`vars()`] function which can diff --git a/oop.asciidoc b/oop.asciidoc index c3858d0c..3c22f1c7 100644 --- a/oop.asciidoc +++ b/oop.asciidoc @@ -192,7 +192,7 @@ include::programs/oop_objvar.txt[] .How It Works This is a long example but helps demonstrate the nature of class and object variables. Here, -`population` belongs to the`Robot` class and hence is a class variable. The `name` variable belongs +`population` belongs to the `Robot` class and hence is a class variable. The `name` variable belongs to the object (it is assigned using `self`) and hence is an object variable. Thus, we refer to the `population` class variable as `Robot.population` and not as diff --git a/problem_solving.asciidoc b/problem_solving.asciidoc index 5cb80a3f..2f61ec4b 100644 --- a/problem_solving.asciidoc +++ b/problem_solving.asciidoc @@ -227,7 +227,7 @@ a `-v` option to make your program become more talkative or a `-q` to make it _q Another possible enhancement would be to allow extra files and directories to be passed to the script at the command line. We can get these names from the `sys.argv` list and we can add them to -our `source` list using the `extend`method provided by the `list` class. +our `source` list using the `extend` method provided by the `list` class. The most important refinement would be to not use the `os.system` way of creating archives and instead using the http://docs.python.org/2/library/zipfile.html[zipfile] or