Ex26.py - url 404 Not found


When I type in the url: https://learnpythonthehardway.org/python3/exercise26.txt.

I keep getting a 404.

Can someone please redirect me to the right link.


Link is correct, I just tried. Perhaps the service was temporarily down.

And welcome!!

Yep, me too. I can click that and it works just fine. Check your firewall settings, anti-virus, and also don’t just click on it. Right click and save as.

Hi Zed and Kesley,

Thank you for your help. It works. :smiley:

Also, quick question.

In the last section. If statements. Were we supposed to add and else statement? Or was it not needed? Just fix whatever you see needs fixing.


Ok but I have two questions before you move on:

  1. Why did it not work and how did you fix it?
  2. If you could fix it, then why didn’t you attempt a fix first?

Let us know so that people who read this in the future can find the solution.

To be honest, I have absolutely zero clue how it fixed itself.

It wasn’t my firewall nor my anti-virus. It magically fixed itself. (See image of the 404)

Ahha! Mystery solved. Note the trailing full stop/period after the “.txt” in the url…

One of my go-to checks when I hit errors, usually syntax errors, is to check colons, semi-colons, commas, and full stops. So easy to mistype and not immediately spot.

In the book the ending was exercise26.txt.

I guess I took it literally instead of it just being a period ending a sentence.

1 Like

Yesssssss, so, when you write a book for a big old publishing company they demand that you use “correct” grammar and punctuation even if that makes code more confusing. Here’s my favorite example:

Alright, old ancient English writing rules require that I put the period inside the quotes, but that is totally wrong because now everyone will type:

python ex1.py.

I fought them like crazy but nope, they insist on putting the damn . or , inside quotes even if it’s completely bad for coding. Now I use fonts instead of quotes:

But, that’s so subtle that people miss it all the time. I usually have to then do this instead:

And that’s the only way to make it reliable for people, but you can’t do that all the time and you can’t reliably cover every conflict between ancient English rules and modern programming education requirements.

1 Like