The best way to learn how to program is to do something useful, so this introduction to Python is built around a common scientific task: data analysis. Our real goal isn’t to teach you Python, but to teach you the basic concepts that all programming depends on. We use Python in our lessons because:
But the two most important things are to use whatever language your colleagues are using, so that you can share your work with them easily, and to use that language well.
Prerequisites
To begin tackling this lesson, you will need to:
- Understand the concepts of files and directories, and the concept of a “working directory”.
- Know how to start up iPython
- Know how to create, edit and save text files.
Setup | Dowload files used on the lesson. | |
00:00 | 1. Running and Quitting | How can I run Python programs? |
00:05 | 2. Variables and Assignment | How can I store data in programs? |
00:15 | 3. Data Types and Type Conversion |
What kinds of data do programs store?
How can I convert one type to another? |
00:25 | 4. Lists | How can I store multiple values? |
00:35 | 5. Tuples & Dictionaries | How can I add semantic value to my collections of multiple values? |
00:45 | 6. For Loops | How can I make a program do many things? |
00:55 | 7. Conditionals | How can programs do different things for different data? |
01:05 | 8. Creating Functions |
How can I define new functions?
What’s the difference between defining and calling a function? What happens when I call a function? |
01:15 | 9. Errors and Exceptions |
How does Python report errors?
How can I handle errors in Python programs? |
01:20 | 10. Live Coding Shielding Problem | How can I perform a shielding calculation using Python? |
02:50 | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.