Introduction to Python
Duration: 1 Week
Summary:
Python is a programming language that can be used for writing anything from very simple scripts to entire applications.
If you are unfamiliar with Python, or need a refresher, please check out online resources suggested below.
If you don't have python installed locally (Mac OS X ships with a version of 2.7, and Yosemite/10.10 has the IDLE IDE as well),
you can use an online IDE such as this one for Python 3 or
this one for Python 2 .
Unfortunately there are syntax and behavioral differences between the two versions, so it is important to know which version you are looking at.
There is a tool called 2to3 that helps migrate version 2.x code to version 3.x, and it's description points to some of the differences.
Learning Objectives
The objective of this module is to introduce basic concepts of Python and exemplify some uses for it.
- Use basic Python syntax
- Literal values (integers, strings)
- Conditionals (if/else statements)
- Functions (calling, defining, scope)
- Loops (for, while)
- Lists and dictionaries
- Write basic Python scripts using
- Console I/O
- File I/O
- Regular Expressions
Course Material
Tutorial style:
- Read: Codecademy's Python track
(This one has File handling)
- Read: Learn Python
(This one contains regular expressions) You don't have to go through both tutorials completely (they mostly overlap), however you do need to go through
sufficient material to cover the topics listed under Module Learning Objectives.
From other languages:
- Read: Wikipedia's Syntax Summary
if you are familiar with any programming language, then this provides a quick overview.
- Read: Comparison with Java
Other information:
- Read: Official documentation from python.org. Be sure to choose the links for the version you are using.
- Read: Built-in libraries for version 3 and version 2
- These are reference documents for interacting with basic and extended types such as sets, date/time types, math functions, file metadata and utility functions, operating system functions, Internet data and protocols, and more.
- Read: StackOverflow for an existing answer, or post it as a new question.
- Read: If you have a question about how to do something, check Introduction to Python Chapter
Conceptual Questions
Practicum