How to Program: Computer Science Concepts and Python Exercises

Series from 2016

Series from 2016

Programming is an eminently learnable skill that gives you unrivalled problem-solving power you can apply in all areas of life. It's also a fun, creat…

Share on
Share on Facebook
Facebook
X
Share on E-mail
E-mail

What Is Programming? Why Python?

"Hello, World!" Following tradition, write a program that produces this greeting as your first exercise in coding a computer program. Learn why Python is the ideal computer language for beginners and many others. After this lesson, follow the onscreen instructions for installing Python and the programming editor PyCharm.

Variables: Operations and Input/Output

Study some of the basic operations of computers. First, investigate the memory hierarchy and what the CPU does. Then consider variables, which are like boxes where units of data are stored in a program. Look at simple arithmetic operations with variables, and try input/output commands.

Conditionals and Boolean Expressions

Any time a computer takes different paths depending on your response, there is usually a conditional statement involved. Delve into these widely used tools, looking at branching points, comparisons, if/then statements, nesting conditionals, and Boolean (true/false) expressions.

Basic Program Development and Testing

Take the plunge and write a program that's useful for saving money! In the process, learn the importance of planning ahead, testing often, and building your code incrementally. As your program takes shape, Professor Keyser describes instructive incidents from computer history and his own experience.

Loops and Iterations

One of the biggest thrills from writing code comes from getting a computer to perform a sequence of instructions repeatedly until a task is complete. Discover the ease of writing such loop programs and also the peril of getting stuck in infinite loops. Investigate while loops, for loops, and iterations.

Files and Strings

Learn the fundamentals of files: what they are, how they're named, and how to interact with them. Typically, the file format that you write to and read from will be one long string - a sequence of alphanumeric characters. See how these differ from binary files such as images, which are composed of 1s and 0s.