Here’s a quick question I often ask students in my Python classes: >>> x = 100 >>> y = x >>> x = 200 After executing the above code, what is the value of y? The answer: >>> print(y)100 Many of my students, especially those with a background in C, are surprised. Didn’t we say…
I teach about 10 different courses to companies around the world, but my favorite remains “Python for non-programmers.” Participants in this course are typically network and system administrators, support engineers, and managers who want to learn some programming skills, but don’t see themselves as programmers. Moreover, many of them took a programming course back when…
Within minutes of starting to learn Python, everyone learns how to define a variable. You can say: x = 100 and voila! Your You have created a variable “x”, and assigned the integer value 100 to it. It couldn’t be simpler than that. But guess what? This isn’t the only way to define variables, let…
When I teach a Ruby or Python class, I always begin by going through the various data types. My students are typically experienced programmers in Java, C++, or C#, and so it no longer surprises me when I begin to describe numbers, and someone asks, “How many bits is an integer?” My answer used to…