Kids, Code, and Computer Science Magazine

Python

freezelight on Flickr

Named after Monty Python, this language is designed to be simple yet powerful, easy to code with lots of features.

For me, one of the more useful books about the Python programming language is a collection of code "recipes" in a cookbook published by O'Reilly. Each recipe is a chunk of code you can drop into your application then tweak. When I went to the local library to see if they had this book, the librarian looked at me strange when I asked if they had a Python cookbook. Then I realized he didn't know Python was both a snake and a software language. Not too many people cook pythons, let alone write up a book of recipes.

Python also refers to Monty Python, the British comedy team from the 1960s and 1970s, which is the source for the name of the Python language (seriously), as well as the general attitude of the Python community. Instead of using the standard terms foo and bar, for example, Python coders tend to use ham and eggs in their code examples. And Python documentation also uses references to Monty Python and the Holy Grail movie.

Started in December 1989 by Guido von Rossum, a Dutch programmer designated as BDFL or Benevolent Dictator for Life, Python has a lot to recommend it as a language for any skill level. The language, for example, has a very simple syntax used to write code. There are no curly quotes to balance out, no semi-colons to forget at the end of most lines. Python also works as scripting, compiled code, and embedded code. The community also has a fairly rigorous style for the use of comments, as well as encouraging the use of docstrings to make it fairly easy to create documentation from the code.

Python is a high level language designed to use less code to perform tasks than other low level languages like C. The community organizes its activities using PEPs, or Python Enhancement Proposals. PEPs cover technical and cultural topics, from functionality proposals to how to write comments to koan-like statements about the ideal Python experience. For example, PEP 20 is called the Zen of Python and says, among other statements, "Explicit is better than implicit."

Perhaps most useful, for students who know they want to study programming in college, Python has a structured way of working, of thinking about programming problems, that fits well with university courses. Python also can be run from a command prompt which is the preferred method of working for many professional coders. Using the command prompt also is the easiest way to demonstrate and learn basic Python.

What Makes Python Special?

Flexibility and diversity, delivered with a sense of humor, makes Python different from many languages. Like Lua, Python code can run several different ways, as a web application, as a standalone application (using third party tools), or as a helper application integrated into a larger software system. This makes the language an option in a wider range of situations than other languages. Python also works for functional, object-oriented, and imperative coding styles, making the language useful to different types of programmers and applications.

Python also uses libraries to access functionality which makes the core language much simpler and lightweight. Coders only need to add a basic set of libraries plus any extra libraries to add functionality they need.

The flexibility of Python has resulted in many versions, for example, Jython for use with Javascript and Cython for use with the C programming language.

How is Python Used?

The language is used somewhat equally as a scripting language to build web applications, like PHP, and non-scripting applications. For example, a number of Google applications use Python, in addition to Go, the transaction optimized language Google created. Python also is used to create small applications to be run as needed by larger applications, many of which are written in different languages. While all coders try to choose the best programming tool for the job, Python is flexible enough to be considered in many situations.

Learn More

Python

http://www.python.org/
http://www.python.org/doc/
http://en.wikipedia.org/wiki/Python_%28programming_language%29
https://groups.google.com/forum/#!forum/comp.lang.python
https://github.com/languages/Python/most_watched

What Makes Python So Awesome (Presentation)

https://ep2013.europython.eu/conference/talks/what-makes-python-so-awesome

A children’s guide to Python programming

http://www.simonhaughton.co.uk/python-programming-guide.html

Python Documentation

http://docs.python.org/3/ (Python 3+)
http://docs.python.org/2.7/

Python Tutorials

http://docs.python.org/3/tutorial/ (Python 3+)
http://docs.python.org/2/tutorial/ (Python 2.7.5)
http://www.learnpython.org/

Help Kids Code Python Links

https://www.kidscodecs.com/resources/programming/python/

Python Tutorials

http://www.tutorialspoint.com/python/

Python Turtle

One-click install of Python (if needed) and interface to learn Python by making a turtle move around the screen.
http://pythonturtle.org/

What Are Some Interesting Things to Do with Python?

http://www.quora.com/Python-programming-language-1/What-are-some-interesting-things-to-do-with-Python

Also In The September 2013 Issue

1 and 0

Binary numbers, based on 1s and 0s, reflect the practical essence of computer hardware: electricity is either on or off. Learn how to write in binary numbers, and the (not so secret) code to transform English language letters into binary numbers and back again.

Simon Haughton Talks about Kids, Python, and Computer Science

Simon recently wrote a short ebook, A children's guide to Python programming, to teach kids ages 5-8 computer programming with Python..

Variables

In most or all software programming languages, variables work like containers to hold numbers, phrases, or other important stuff used in several places in your code. Here's how they work in several common languages.

Local Coding and Technology Groups

Girls Who Code, CoderDojo, and other local groups are great places to learn how to program, meet people, and help others learn.

How to Build a Computer

Building your own computer is a great way to not only save money, and get more processing power, but also to learn about the less obvious parts of software programming.

News Wire Stories for September 2013

Interesting stories about computer science, software programming, and technology for the month of August 2013.

Online Coding Schools

There are plenty of places online to learn one or more software programming languages. Here's a short list with some guidelines to evaluate all your options.

Computer science is no more about computers than astronomy is about telescopes, biology about microscopes, or chemistry about beakers and test tubes. Science is not about tools. It is about how we use them, and what we find out when we do.

Learn More Links for September 2013

Links from the bottom of all the September 2013 articles, collected in one place for you to print, share, or bookmark.

Claude Shannon

His work ties together two topics for this issue of the magazine: binary numbers and circuit design. Without Shannon, computers and computer science could have been very different.