Skip to content

Latest commit

 

History

History
119 lines (90 loc) · 4.56 KB

README.md

File metadata and controls

119 lines (90 loc) · 4.56 KB

Python programming tutorial

This is a Python 3 programming tutorial for beginners. If you have never programmed before click here to find out what programming is like and get started.

This tutorial is aimed at people with no programming experience at all or very little programming experience. If you have programmed a lot in the past using some other language you may want to read the official tutorial instead.

You can use Python 3.2 or any newer Python with this tutorial. Don't use Python 2. If you write a Python 2 program now someone will need to port it to Python 3 later, so it's best to just write Python 3 to begin with. Python 3 code will work just fine in Python 4, so you don't need to worry about that.

List of contents

The tutorial consists of two sections:

Basics

This section will get you started with using Python and you'll be able to learn more about whatever you want after studying it.

  1. What is programming?
  2. Installing Python
  3. Getting started with Python
  4. ThinkPython: The way of the program
  5. Variables, Booleans and None
  6. Using functions
  7. If, else and elif
  8. Handy stuff with strings
  9. Lists and tuples
  10. Loops
  11. Trey Hunner: zip and enumerate
  12. Dictionaries
  13. Defining functions
  14. Writing a larger program
  15. What is true?
  16. Files
  17. Exceptions
  18. Modules
  19. Classes

Advanced

If you want to learn more advanced techniques, you can also read this section. Most of the techniques explained here are great when you're working on a large project, and your code would be really repetitive without these things.

You can experient with these things freely, but please don't use these techniques just because you know how to use them. Prefer the simple techniques from the Basics part instead when possible. Simple is better than complex.

  1. Advanced stuff with functions
  2. Magic methods
  3. Iterables, iterators and generators

Other things this tutorial comes with

Frequently asked questions

How can I thank you for writing and sharing this tutorial?

You can star this tutorial. Starring is free for you, but it tells me and other people that you like this tutorial.

Go here if you aren't here already and click the "Star" button in the top right corner. You will be asked to create a GitHub account if you don't already have one.

How can I read this tutorial without an Internet connection?

  1. Go here if you aren't here already.

  2. Click the big green "Clone or download" button in the top right of the page, then click "Download ZIP".

    Download ZIP

  3. Extract the ZIP and open it. Unfortunately I don't have any more specific instructions because how exactly this is done depends on which operating system you run.

  4. Run make-html.py and follow the instructions.

If you have git and you know how to use it, you can also clone the repository instead of downloading a zip and extracting it. An advantage with doing it this way is that you don't need to download the whole tutorial again to get the latest version of it, all you need to do is to pull with git and run make-html.py again.

Authors

I'm Akuli and I have written most of this tutorial, but these people have helped me with it:


If you like this tutorial, please give it a star.

You may use this tutorial freely at your own risk. See LICENSE.

List of contents