Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.21 KB

the-way-of-the-program.md

File metadata and controls

31 lines (24 loc) · 1.21 KB

ThinkPython: The way of the program

ThinkPython is a free Python book. Its first chapter is about programming in general. Read it here. Read the glossary also, but don't study it too much. Some things in it are useful to know, but I think studying it carefully would be really boring.

When you're done reading, read the summary and make sure you've learned everything.

Summary

  • Now you should have some kind of idea about what programming is.
  • Each value has a type, and you can find that out with type(value). For example, writing type(123) to the Python prompt does the same thing as writing int to the prompt.
  • Types and classes are the same thing (in Python 3).
  • Some of the most commonly used types are:
    • int is short for integer. 1 and 2 are ints.
    • float is short for floating point number. 1.0 and 3.14 are floats.
    • str is short for string. "hello" and 'hello' are strings. It doesn't matter if you use 'single quotes' or "double quotes", they do the same thing in Python.

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

Back to the list of contents