How to Program
Computer Science Concepts and Python Exercises

How to Program - Computer Science Concepts and Python Exercises
Show More

24 episodes in this series

Episode 1 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…
Episode 2 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…
Episode 3 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…
Episode 4 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…
Episode 5 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…
Episode 6 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…
Episode 7 Operations with Lists
Python makes it very easy to create lists and perform a wide range of operations on them. Learn the fundamentals of building lists. Then experiment with indexing into lists, looping…
Episode 8 Top-Down Design of a Data Analysis Program
Take what you have learned about lists, loops, files, and other techniques and design a program that lets you analyze weather data. Sound daunting? Discover the trick of top-down design,…
Episode 9 Functions and Abstraction
One of the key ideas in computer science is abstraction--using simple interfaces to manage complex procedures. See how functions can simplify away the details of complex process, freeing attention to…
Episode 10 Parameter Passing, Scope, and Mutable Data
Complete your introduction to elementary programming by looking at parameters--the major technique for passing information through functions. Learn when a parameter or variable is "in scope," how to work with…
Episode 11 Error Types, Systematic Debugging, Exceptions
Confront the nemesis of all computer programmers: bugs. First, look into the history of this peculiar term. Then take a systematic approach to solving mysterious glitches in your own programs.…
Episode 12 Python Standard Library, Modules, Packages
Discover the remarkable programming tools called modules that you have at your fingertips with Python. Modules are ready-made programs that can be imported into your code as you write it,…
Episode 13 Game Design with Functions
Use the knowledge you've gained so far to design a grid-based matching game--an entertaining way to practice top-down development of more complex programs using functions. You'll see how rough-and-ready lines…
Episode 14 Bottom-Up Design, Turtle Graphics, Robotics
Now experiment with bottom-up design, an approach that starts with the available elements and builds from there. Utilize a Python module called turtle graphics to model robot motion, relying on…
Episode 15 Event-Driven Programming
Explore the visual style of programming seen on the web and in the graphical user interface of an operating system. Get started with pyglet, a Python package created to help…
Episode 16 Visualizing Data and Creating Simulations
Delve into data visualization and simulations--two areas where computers have had a revolutionary but under-recognized impact. Learn how to do both with matplotlib, a Python package for creating plots, graphs,…
Episode 17 Classes and Object-Oriented Programming
Learn about an exciting approach to programming called object-oriented design, which bundles functions together with data into a series of objects, whose tools and properties can be defined in a…
Episode 18 Objects with Inheritance and Polymorphism
Dig deeper into object-oriented design, seeing how encapsulation--combining data and the functions that deal with data into a single package--is the basis for two other object-oriented features: inheritance and polymorphism.…
Episode 19 Data Structures: Stack, Queue, Dictionary, Set
Data structures allow you to perform operations more effectively. Start with two of the most basic data structures, stacks and queues, discovering that both can be executed using lists. Then…
Episode 20 Recursion and Running Times
Expand your study of algorithms to cover recursion, one of the most fascinating ideas in computer science. Apply recursion to form a pair of sorting algorithms. Then see how another…
Episode 21 Graphs and Trees
In computing, a graph is a mathematical structure composed of vertices and edges. Discover its incredible power to capture relationships such as the airline routes between cities and the friends…
Episode 22 Graph Search and a Word Game
Examine a famous graph algorithm called breadth-first search, which shows the shortest path connecting nodes in a tree. Use this technique to write a program creating an entertaining game, in…
Episode 23 Algorithms: Searching and Sorting
Enter the realm of algorithms, the heart of computer science. See how a well-designed algorithm--a general set of steps that accomplish a task--allows you to work out the logic of…
Episode 24 Parallel Computing Is Here
One of the major trends in the present and future of computing is parallel processing. Put this clever technique to work in Python. Then close the course with Professor Keyser's…

Related videos

Our Night Sky Series
For thousands of years, the star-filled sky has been a source of wonder, discovery, and entertainment. All you need to feel at home in its limitless expanse is Our Night Sky, a richly illustrated 12-episode course that gives you an unrivaled tour around the sky--all while teaching you about the…
Experiencing Hubble - Understanding the Greatest Images of the Universe Course
For more than 20 years, the Hubble Space Telescope has been amassing discoveries that rival those of history's greatest scientists and explorers, making it the most important scientific instrument ever built. This program is a visual feast of images taken by Hubble. Go on a dazzling voyage of discovery that…
The Mathematics of Games and Puzzles - From Cards to Sudoku Series
Whether it's chess, poker, or Sudoku, most games have this in common: Everything you need to win is rooted in mathematics. Now, using nothing more than a simple grasp of math, you can discover optimal ways to win games and solve puzzles with the speed and accuracy of professional players.…
An Introduction to Formal Logic
Logic is intellectual self-defense against such assaults on reason and also a method of quality control for checking the validity of your own views. But beyond these very practical benefits, informal logic--the kind we apply in daily life--is the gateway to an elegant and fascinating branch of philosophy known as…
Understanding the World's Greatest Structures - Science and Innovation from Antiquity to Modernity Course
The Giza pyramids. Brunelleschi's dome. The Brooklyn Bridge. Each of these structures is iconic. They are visited by millions of people each year because they provoke a sense of awe and wonder. They are as beautiful to behold as they are fascinating to study: just how did the engineers who…
The World’s Greatest Geological Wonders - 36 Spectacular Sites Collection
Geological wonders are like great works of art. They are impressive, beautiful, mysterious, and surprising. Whether you are planning your next vacation or exploring the world from home, this course is your gateway to an unrivaled adventure. By the time you complete this course, you will have experienced more than…
Thinking about Cybersecurity - From Cyber Crime to Cyber Warfare Series
Virtually every aspect of global civilization now depends on interconnected cyber systems to operate... which makes keeping these systems safe from threat one of the most pressing problems we face. Get an intriguing look at the structure of the Internet, the unique dangers it breeds, and the ways we're learning…
The Science of Information - From Language to Black Holes
The science of information is the most influential, yet perhaps least appreciated field in science today. Never before in history have we been able to acquire, record, communicate, and use information in so many different forms. Never before have we had access to such vast quantities of data of every…
Redefining Reality - The Intellectual Implications of Modern Science Series
No subject is bigger than reality itself, and nothing is more challenging to understand, since what counts as reality is undergoing continual revision and has been for centuries. For example, the matter that comprises all stars, planets, and living things turns out to be just a fraction of what actually…
Physics and Our Universe: How It All Works Series
Physics is the fundamental science. It explains how the universe works! All you need to begin exploring physics is a grasp of high-school algebra. These lessons are intensively illustrated with diagrams, animations, graphs, and other engaging visual aids and introduce you Newtonian mechanics, oscillations and waves, thermodynamics, electricity and magnetism,…
What Is Programming? Why Python?
Episode 1 of How to Program
"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.
The Science of Extreme Weather
Thanks to an ongoing revolution in the science of meteorology, we can now understand how extreme weather conditions arise, produce far more accurate forecasts, and know how to protect ourselves when dangerous conditions develop. The Science of Extreme Weather is your field guide to the worst that Earth's atmosphere can…