| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Whenever you search in PBworks or on the Web, Dokkio Sidebar (from the makers of PBworks) will run the same search in your Drive, Dropbox, OneDrive, Gmail, Slack, and browsed web pages. Now you can find what you're looking for wherever it lives. Try Dokkio Sidebar for free.

View
 

FrontPage

Page history last edited by Jeremy R. Gray 14 years, 7 months ago

 

Can you count to a million in one second ???

 

I'm sure you can count easily, maybe in more than one language. But can you count to a million in one second, or ten million in just a few seconds? Imagine what it would be like! You can really do it, using an ordinary household computer and a simple, powerful language called python. Python is a language for programming digital computers. Scientists and engineers at NASA and google use python. You can too, for free.

 

This wiki is about more than counting--ever so much more. It is about enabling curious people to enhance their minds, to gain mental powers beyond what they imagine is possible. Counting stupendously fast is just an example (and hopefully an eye-opening experience). But this wiki is not about counting, and its not even about python, not really. Python is just a language (and a lovely one)--but there are many other nice languages. And a computer is just a tool. This wiki is about learning how to enhance your abilities, using a computer. Like learning anything worthwhile, it will take some effort and be rewarding--you can do it!

 

To do the projects on this wiki, you don't have to know how computers work, or how to program. Being able to read, type, and follow instructions will help a lot, and ~6th grade math will be useful at times (and not necessary for most things). Feeling adventurous and trying things yourself is terrific.

 

Why program a computer?

A digital computer will just sit there, like a brick, unless it has been told how to do specific things, and told when or under what circumstances to do them. A program is a set of instructions that tell a computer what to do. A program is like a recipe: a list of ingredients and instructions that can be written down and shared with other people so that a desired outcome can be reproduced each time. A recipe itself is not food, you can't eat a recipe. And a program itself is not active, it has to be made to run before anything will happen. There can be several variations on the same recipe, and recipes for very different things. What kind of things can programs do? There are far too many to list them all, but things like:

  - let people to talk to each other by cell phone

  - count to a million as fast as possible

  - email a cute photo to grandma

  - draw a 31-pointed star, or a star with as many points you like

  - make a message hard for anyone to read, unless you tell them the code (like this: pbatenghyngvbaf! lbh penpxrq gur frperg pbqr! uzzz ebg-13 vf abg fb frpher, I'yy unir gb gel uneqre arkg gvzr)

  - crack a code, like the code that your friend forgot how to decode after encrypting a message to you (oops)

  - land a space probe on another planet

  - play a song on an iPod

Each of these activities is useful or fun--a "thing" someone wanted to do, or create, or learn. And hopefully you find it more interesting than a brick. (If you really like bricks, you might enjoy this more than after-school python. Your choice.)

 

Programming enhances the power of your mind

Its like riding a bicycle. A bike does not know how to ride itself, and it does not take you somewhere by magic. It is a tool you can use for transportation. You could walk, of course, but bicycles are designed to enhance your effort. You can ride a bike faster and further than you can run. A bicycle enhances your abilities, and extends your range. It is a tool, you make things happen. And bikes can be really fun as well. In the same way, computers are a tool for your mind. They enhance the power of your mind, they extend your mental capacities. And can be really fun.

 

Whenever a computer does something interesting (or uninteresting, anything at all actually), it is not just a computer doing it. Rather, it means that someone told the computer what to do, using a program. Computers don't magically "just know" what to do. They are noteworthy for their speed (really fast!!) and for their mindlessness (they do precisely what they are told, and never get bored, even when counting to a million).

 

Often, there are several good ways to do something or to solve a problem--even when using the same programming language. Your friend might come up with a different way than you do to solve the same problem. If your way of doing it works, its right! Its surprisingly satisfying to come up with your own program, and then have the computer demonstrate that your way was correct. And you can learn a lot by checking out other correct solutions. Some are just lovely!

 

Programming is something you do, not just read about

When trying anything for the first time, everyone can expect to make mistakes, and to learn from them. Learning to ride a bike is not easy, but its not impossible either, even if it might have seemed impossible at first. And learning to read was not easy, either, and now you probably read without even thinking about it. Making mistakes is fine, even good--it means you are trying, which is by far the most important thing. Keep trying! A mistake is an opportunity. Programming takes some effort and determination, and its normal to feel discouraged sooner or later. That is good--it means you care about enhancing your mind. So its really worth trying, and trying again, just like it was worth it when learning to read or ride a bike. Take a break if you get frustrated. Play frisbee or something, go for a bike ride. You'll get the hang of programming, just ask questions and keep trying.

 

This wiki describes various things you can do, or problems that can be solved, using python. It also has links to hints and other resources. You can expect to read, think, and understand what you want to do, and try things out.

 

A big part of learning to program a computer is figuring out why something did not work the way you thought it would. So in the projects, you can expect to: 1) think, 2) try things out, and 3) see what happens. Then think some more! Did it work without a syntax error? (These will come to be a good friend!) If it worked, did it work exactly the way you expected? Will it always work the way you expect? What if you change something? Could it be better or more useful?

 


 

What do you need to start?

You need to be able to work on a computer that has python. If you have access to a computer with mac OS 10.2 (or higher) or with a version of linux, you are probably all set. If you have windows, here are some ideas. Depending on your computer and your degree of experience you might need to help with setting things up.

 

This tutorial is designed in the form of several chapters, each of which has various projects that share a theme. Take your time with each chapter (and each project), try to really understand most things, especially those listed at the end, in the "Review..." section. Savor each one, and play around to try to understand things even more thoroughly. Rushing through now will mean going more slowly later. There's definitely no need to finish one chapter or even one project in one sitting. Come back again whenever. 

 

The order of the chapters does matter. Later chapters assume that you know and remember things from earlier ones (like how to start python, or how to save a program to a file). So start with Chapter 0, Starting python. A review and memory-practice self-quiz are given at the bottom of each project, covering key terms and concepts. The quiz is not a test, its just a way to help yourself remember. It is memory-practice. The more you practice remembering something the better you will remember it. 

 

There is a link to all the chapters in the side-bar, in order. Just find the sidebar (look for a giant foot), and click the first chapter, 0 - Start python. After you finish that one, click on 1 - Hello world!

 


 

Want to help make this site better?

 

Have an idea? See a typo or an outright mistake? Awesome! You can help others by leaving a comment on any page, at the bottom. (To comment, you need a pbwiki account, click here to sign up for one, free.)

 

Want to contribute several pages? Really awesome! Here's a vision for how the site could evolve. For discussion or more personal inquiries, just click the "Contact the owner" link (below) to send an email.

 


 

Click here for acknowledgments, and copyright, and license (CreativeCommons).

 

To comment, you need a pbwiki account, click here to sign up for one, free.

 

Comments (0)

You don't have permission to comment on this page.