Skip to content

Latest commit

 

History

History
87 lines (72 loc) · 4.81 KB

File metadata and controls

87 lines (72 loc) · 4.81 KB

Python for Programmers

Welcome to a deeper look at Python!

This is an active overview of Python's core language features, data structures, and object model. When done, participants will be able to use common data structures like lists, sets, and dictionaries. They will be able to define and use functions (including with default, keyword, and variable parameter sets), classes (including creating new types that interface with built-in functions), and modules (both defining your own and importing others). Class examples reveal the power and limits of the Pythonic idiom.

This class is for programmers. You're expected to be able to write code in some language, using control flow (if/else, loops), functions, and ideally classes, to solve a problem, e.g. "given an input string like this paragraph, generate a count of the number of times the word 'is' is used." If that doesn't describe you, you'll want to spend some time coding before you take this class. A great place to start is our introductory Python class, Start Programming With Python.

Quick Start

SEL employees enroll in the class on Workday.

Click below to launch your own Binder or Google Colab instance of this class:

Binder

Open In Colab

Contents

These Jupyter Notebooks are a sandbox of examples we'll walk through in class. They can also serve as a start to your own notes for reference. Class has two segments: 1) overview, and 2) data structures & organizing concepts.

  1. 1-overview.ipynb: Practice using core features of the language: keywords and operators, comments and docstrings, indentation, NoneType, strong dynamic typing, simple vs compound statements, conditionals, truthiness, ducktyping, built-in functions, magic methods, the object model, scope, garbage collection, passing parameters by object reference, what "Pythonic" means.
  2. 2-data_structures_and_organizing_concepts.ipynb: Build and manipulate common data structures like lists, dictionaries, tuples, strings, and sets. Distinguish types that are immutable/hashable or ordered/indexed. Specify slices and loop over container classes. Define and call functions with default parameters, keyword parameters, and variable parameter lists. Create your own classes with the unique data structure and functionality you need to solve your problems, employing magic methods for construction and polymorphism. Organize your problem's object model using inheritance.

In addition there are two extra reference guides here:

  • reference.ipynb: Start here. Quickly see some of the common idioms sprinkled widely through the class notebooks above, like printing string representations of objects, importing modules/packages/libraries, inspecting an object's interface, accessing the documentation, formatting strings.
  • q_and_a.ipynb: A growing list of questions and answers that have emerged from class discussions. Please propose your own additions to the instructor.

External Resources

Official Python language documentation: intro tutorial, built-in functions, syntax reference, the standard library, howtos, using Python on Windows.

Other Python language resources: Windows get-started guide, moving to Python from other languages guide, StackOverflow Q&As, best-practices "Hitchhikers Guide to Python", cheat sheets, van Rossum's "History of Python" blog.

Jupyter Notebooks resources: reference guide for beginner class, official documentation, cheat sheet.

Style guides: Python style guide PEP 8, Google Python style guide.