PyOhio 2018 Recursion Tutorial
Posted by Al Sweigart in python
This page has materials for folks taking my two-hour tutorial, A Beginner's Guide to Tackling Recursion at PyOhio 2018 or following its video recording.
Writings from the author of Automate the Boring Stuff.
Posted by Al Sweigart in python
This page has materials for folks taking my two-hour tutorial, A Beginner's Guide to Tackling Recursion at PyOhio 2018 or following its video recording.
Posted by Al Sweigart in python
The Zen of Python by Tim Peters are 20 guidelines for the design of the Python language. Your Python code doesn’t necessarily have to follow these guidelines, but they’re good to keep in mind. The Zen of Python is an Easter egg, or hidden joke, that appears if you run import this
.
Posted by Al Sweigart in python
In Python, you can increase the value of a variable by 1
or reduce it by 1
using the augmented assignment operators. The code spam += 1
and spam -= 1
increments and decrements the numeric values in spam
by 1
, respectively.
Other languages such as C++ and Java have the ++
and --
operators for incrementing and decrementing variables. (The name of C++ itself reflects this; the name is a tongue-in-cheek joke that indicates it's an enhanced form of the C language.) Code in C++ and Java could have ++spam
or spam++
. Python wisely doesn't include these operators; they are notoriously susceptible to subtle bugs.
Posted by Al Sweigart in python
Before we can get a nuanced answer to "Are tuples mutable or immutable?", we need some background information.
Posted by Al Sweigart in programming
I often get emails say little more than "Why doesn't my program work?" Often I can't answer them; either I don't have enough information about your problem or you're asking me about something I don't know anything about.
Posted by Al Sweigart in teaching
This post contains the lessons I've learned and my process for creating video tutorials, and I hope others who want to do the same find it useful. While this post is specific to Udemy and programming courses, the same lessons probably apply to all online courses.
Posted by Al Sweigart in django
Django is a web app framework for Python (similar to Rails for Ruby). It implements common web app features so you don't have to write that code. Dreamhost is a web host that offers cheap but reliable web servers. Their shared hosting plan is $11 a month, and provides more than enough disk space and bandwidth for personal sites.
Posted by Al Sweigart in news
For the last few months I've been putting together an online course that follows my latest (and free) book, "Automate the Boring Stuff with Python". It is now available.
Posted by Al Sweigart in news
I've written an article for OpenSource.com called APIs, not apps: What the future will be like when everyone can code, where I write about a coming future where programming ability is in the hands of everyone.
Posted by Al Sweigart in programming
Posted by Al Sweigart in news
The 3rd edition of "Invent Your Own Computer Games with Python" is now available.
Posted by Al Sweigart in python
You've written a Python 3 program and want to make it available in other languages. You could duplicate the entire code-base, then go painstakingly through each .py file and replace any text strings you find. Fortunately, Python provides a solution with the gettext
module.
Posted by Al Sweigart in python
This tutorial teaches how to write a bot that can automatically play the Flash game Sushi Go Round. The concepts in this tutorial can be applied to make bots that play other games as well.
Posted by Al Sweigart in python
Text adventures are an old game genre where the entire world is textually described as a series of rooms. Play involves entering simple text commands such as "move north" or "eat pie". Each room in the game world has its own text description, items on the ground, and exits to adjacent rooms.
Posted by Al Sweigart in news
I've organized a large collection of free and non-free books on a new part of this site: The Invent with Python Bookshelf.
Posted by Al Sweigart in news
This blog post is those still new to programming and have probably heard about "object-oriented programming", "OOP", "classes", "inheritance/encapsulation/polymorphism", and other computer science terms but still don't get what exactly OOP is used for. In this post I'll explain why OOP is used and how it makes coding easier.
Posted by Al Sweigart in python
IDLE Reimagined is the project name for a redesign for Python's default IDLE editor with focus as an educational tool. IDLE's chief utility is that it comes installed with Python, making it simple for newbies to start programming. But professional software developers don't use IDLE as their IDE. Instead of turning IDLE into a sophisticated IDE for professional software developers, it can be tooled with features specifically to make it friendly to those learning to program.
Posted by Al Sweigart in programming
The geeks have inherited the earth. A couple decades ago if you talked with friends in a chat room, you were cast as a socially-awkward nerd. Doing the same today just means you're a typical Facebook user. Broadband Internet connections and smartphones have taken the Information Age that technically started in the 1970s with PCs and pushed it into daily mainstream life.
Don't get me wrong: You should learn to program. But lost in this hype is a plainspoken reason: NO, SERIOUSLY, WHY SHOULD I LEARN TO CODE?
Posted by Al Sweigart in python
I had the idea to use Google Maps' API to draw out a map of all the Muni routes. This would have the benefit of the system map PDF but also be easier to load and navigate. I have no experience using the Google Maps API and am vaguely aware that there's public data about Muni bus routes, but I'll learn along the way.
Posted by Al Sweigart in programming
HTML is not a programming language. You can't write a "program" that, say, calculates the average of ten numbers with HTML. While some may point out that HTML is a "markup language", this doesn't clarify how that is different from a programming language. This isn't meant to be a thorough argument, but rather a brief explanation that goes just a bit more in detail than "HTML isn't a programming language but instead a markup language."