21
I started learning Python with a book from 2015 and the examples were all broken
The book used Python 2.7 and all the code snippets for reading files would just crash in Python 3.9. I spent two days stuck before a friend told me to check the version difference. I had to rewrite about 20 practice scripts to get them working. Has anyone else run into this kind of problem with older learning materials?
3 comments
Log in to join the discussion
Log In3 Comments
caleb_stone16d ago
Python 2 to 3 was a huge mess for beginners. The print statement needing parentheses is the classic example, but the file handling change is a real trap. open() works differently now, and input() acts like raw_input() used to. It's wild they didn't make a cleaner break.
9
the_nina16d ago
Man, my old JavaScript book from 2010 is basically useless now too.
2
masonbell13d ago
Honestly, I just keep the old books for the core ideas and hit the official docs for syntax now. Caleb_stone is right about the Python 2 to 3 mess being a real trap for file stuff. It's easier to treat old guides as history lessons and learn the new way straight from the source.
1