Learn Python The Hard Way | Page 9

Not Available
you copy-paste, you are cheating yourself out of the effectiveness of the lessons.
A Note On Practice And Persistence
While you are studying programming, I'm studying how to play guitar. I practice it every day for at least
2 hours a day. I play scales, chords, and arpeggios for an hour at least and then learn music theory, ear
training, songs and anything else I can. Some days I study guitar and music for 8 hours because I feel
like it and it's fun. To me repetitive practice is natural and just how to learn something. I know that to get
good at anything you have to practice every day, even if I suck that day (which is often) or it's difcult.
Keep trying and eventually it'll be easier and fun.
As you study this book, and continue with programming, remember that anything worth doing is difcult
at rst. Maybe you are the kind of person who is afraid of failure so you give up at the rst sign of
difculty. Maybe you never learned self-discipline so you can't do anything that's “boring”. Maybe you
were told that you are “gifted” so you never attempt anything that might make you seem stupid or not
a prodigy. Maybe you are competitive and unfairly compare yourself to someone like me who's been
programming for 20+ years. 4 The Hard Way Is Easier

Learn Python The Hard Way, Release 2.0
Whatever your reason for wanting to quit,
keep at it. Force yourself. If you run into an Extra Credit you
can't do, or a lesson you just do not understand, then skip it and come back to it later. Just keep going
because with programming there's this very odd thing that happens.
At rst, you will not understand anything. It'll be weird, just like with learning any human language.
You will struggle with words, and not know what symbols are what, and it'll all be very confusing. Then
one day BANGyour brain will snap and you will suddenly “get it”. If you keep doing the exercises and
keep trying to understand them, you will get it. You might not be a master coder, but you will at least
understand how programming works.
If you give up, you won't ever reach this point. You will hit the rst confusing thing (which is everything
at rst) and then stop. If you keep trying, keep typing it in, trying to understand it and reading about it,
you will eventually get it.
But, if you go through this whole book, and you still do not understand how to code, at least you gave it
a shot. You can say you tried your best and a little more and it didn't work out, but at least you tried. You
can be proud of that.
License
This book is Copyright (C) 2010 by Zed A. Shaw. You are free to distribute this book to anyone you
want, so long as you do notcharge anything for it, andit is not altered. You must give away the book in
its entirety, or not at all. This means it's alright for you to teach a class using the book, so long as you
aren't charging students for the bookand you give them the whole book unmodied.
Special Thanks
I'd like to thank a few people who helped with this edition of the book. First is my editor at Pretty Girl
Editing Services who help me edit the book and is just lovely all by herself. Then there's Greg Newman,
who did the cover jacket and artwork, plus reviewed copies of the book. His artwork made the book look
like a real book, and didn't mind that I totally forgot to give him credit in the rst edition. I'd also like to
thank Brian Shumate for doing the website landing page and other site design help, which I need a lot of
help on.
Finally, I'd like to thank the hundreds of thousands of people who read the rst edition and especially the
ones who submitted bug reports and comments to improve the book. It really made this edition solid and
I couldn't have done it without all of you. Thank you. License
5

Learn Python The Hard Way, Release 2.0
6 The Hard Way Is Easier

Exercise 0: The Setup
This exercise has no code. It is simply the exercise you complete to get your computer setup to run
Python. You should follow these instructions as exactly as possible. For example, Mac OSX computers
already have Python 2, so do not install Python 3 (or any Python).
Mac OSX
To complete this exercise, complete the following tasks: 1.Go tohttp://learnpythonthehardway.org/exercise0.htmlwith your browser, get the gedittext ed-
itor, and install it.
2.Put gedit (your editor) in your Dock so you can reach it easily.
(a)Run gedit so we can x some stupid defaults it has.
(b)Open Preferences from thegedit menu and select theEditortab.
(c)Change Tab width: to 4.
(d)Select (make sure a check mark is in) Insert spaces instead of tabs .
(e)Turn on “Automatic indentation” as well. (f)Open the Viewtab and turn on “Display line numbers”.
3.Find your “Terminal” program. Search for it. You
Continue reading on your phone by scaning this QR Code

 / 58
Tip: The current page has been bookmarked automatically. If you wish to continue reading later, just open the Dertz Homepage, and click on the 'continue reading' link at the bottom of the page.