Trying to learn Python; is this book incorrect?

  • Context: Python 
  • Thread starter Thread starter jkoster09
  • Start date Start date
  • Tags Tags
    Book Python
Click For Summary

Discussion Overview

This discussion revolves around the challenges faced by a participant learning Python using a specific book titled "The Python Book: The ultimate guide to coding with Python." The focus includes issues with code functionality, the quality of the book, and preferences for physical versus digital resources.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Meta-discussion

Main Points Raised

  • One participant reports that code from the book does not work as expected, particularly with the append method in a list.
  • Another participant identifies a typo in the code ("apppend" instead of "append") as a likely source of the error.
  • There is a suggestion that the book may not be of high quality based on its availability on torrent sites, raising concerns about its legitimacy.
  • Some participants express a preference for physical books over digital resources, citing a personal need for tangible materials.
  • Questions arise regarding the authorship and classification of the book as a "bookazine" rather than a traditional book.

Areas of Agreement / Disagreement

Participants express differing opinions on the quality of the book and its usefulness. While some suggest it may not be a good resource, others defend their choice of using a physical book despite the availability of online resources. The discussion remains unresolved regarding the overall value of the book.

Contextual Notes

There are unresolved issues regarding the book's content, its classification, and the appropriateness of using Python 2.x versus 3.x, as well as the implications of using a book with potential errors.

jkoster09
Messages
15
Reaction score
0
I had a brief stint with Python a year or two ago, and after I learned of the Raspberry Pi I knew I should try to learn again. I purchased this book, knowing full well that the online resources would be sufficient, and some of the code doesn't seem to work.

hello_str = "Hello World"

hello_bool = True

hello_truple = (21, 32)

hello_list = ("Hello,","this","is","a","list")

hello_list = list()
hello_list.append("Hello,")
hello_list.apppend("this")
hello_list.append("is")
hello_list.append("a")
hello_list.append("list")

hello_dict = {"first_name":"*My First Name*",
"last_name":"*My Last Name",
"eye_color":"*My Eye Color*"}
print(hello_list[4])
hello_list[4]+="!"

This is the code copied verbatim from the book. It gets an error at the part with multiple append commands, but even when I comment that out it also hangs on the final line. What am I missing here? If it's any help, the book is simply titled "The Python Book: The ultimate guide to coding with Python". It says it's written for 2.x, but I tried 3 just to be sure. No luck.
 
Technology news on Phys.org
jkoster09 said:
hello_list.apppend("this")
Well this looks like the source of the error. Works fine for me with this fixed.
An important part of coding is learning how to debug - so its good to learn how to interpret the error messages that the interpreter throws at you.
 
Thanks, that helped me fix it. I didn't even notice that it wasn't the first append that it hung up on, or else I might have fixed it myself. Thank you.
 
jkoster09 said:
hello_list.apppend("this")
It looks like they appended an extra 'p' on "append". Was this how it was in the book?
 
Mark44 said:
It looks like they appended an extra 'p' on "append". Was this how it was in the book?
No, that was my fault. I'm going to stick to sleep depravity as my excuse for that obvious slip up.
 
jkoster09 said:
If it's any help, the book is simply titled "The Python Book: The ultimate guide to coding with Python". It says it's written for 2.x, but I tried 3 just to be sure. No luck.
From what I can tell, that is not a good book. How did you find it? Just because there are lots of free (but illegal) downloads for that book does not mean it is good. From what I've seen, if the first google page on searching the title of a book comprises almost entirely links to various torrent sites, run away. It's not a good book.

Python is an open source language, and as such, you can find lots and lots of free (and legal) tutorials on how to program in python. As a starter, I suggest you go to the source, python.org. For python2, look to https://docs.python.org/2/tutorial, and for python3, https://docs.python.org/3/tutorial. They're both free, they're both very good, and they're both legal.
 
I bought it at a local bookstore, so it is completely legal. And I recognize that there are many free and probably better online resources, but I have a need for the physical thing that I can't explain. I'll use it to some extent, but I'll almost certainly resort to these online sources soon, just not yet.
 
jkoster09 said:
the book is simply titled "The Python Book: The ultimate guide to coding with Python".
Who's the author? I can't find anything with that title on amazon.com.
 
https://www.imagineshop.co.uk/the-python-book.html
 
Last edited by a moderator:
  • #10
Aha, it's a "bookazine", not a "real book." I've seen this sort of thing in the magazine section of my "local" Barnes & Noble. They may even carry Imagine Publishing's bookazines; I've seen other UK publications there.
 
  • #11
jkoster09 said:
And I recognize that there are many free and probably better online resources, but I have a need for the physical thing that I can't explain.

That is something I totally understand. To me, there's just something magical about words on paper that words on a computer screen cannot yet replicate. If you wish, you can highlight those words on paper with a yellow marker in the blink of an eye. You can do that with a computerized book,but not in a blink of an eye. You can flip from page 1 to page 101 in the blink of an eye with a book on paper; good luck with that with a computerized book.

Done wrongly, that computer-based facsimile is just that, a facsimile. Done correctly, a computer-based version of a book or journal paper is anything but a facsimile of a paper copy. Good luck searching a paper copy for a keyword. It's cinch with a properly done computerized version. That's but one of the magical features of computerized papers.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
Replies
3
Views
2K
Replies
1
Views
2K
Replies
6
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 43 ·
2
Replies
43
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 5 ·
Replies
5
Views
4K