Skip to content

Activities for teaching Python online, taken from my IDCE 302 course at Clark University

License

Notifications You must be signed in to change notification settings

Shadrock/online-python-course

Repository files navigation

Online Introductory Python Course Materials

This repo contains lectures, labs, and other materials for a six-week introductory Python course. This course can be delivered entirely online. By the end of these activities, students should:

  • have a good understanding of the basics of Python, writing code, and software development in general;
  • demonstrate proficiency creating a range of different scripts; and
  • have online examples the show their ability to navigate, comment on, document, and share code.

Required Software / Web Applications

This class uses Python 3.x for coding, Jupyter notebooks – specifically Google Colaboratory – for demonstrations and lectures, and Github for submitting code work. I have found that using Google Colaboratory (or “Colab”) greatly reduces the frustration of relying on University IT maintenance and labs since the coding is done via browser and everything is run on Google servers. The downside is that it requires good connectivity. There are other huge benefits to using Jupyter notebooks, including the fact that you can combine code, outputs, explanatory text, and multi-media files. Read more about them in this Nature blog post. Colab is well documented and a good first stop for students is the Overview of Colab Features.

Although all of the activities presented here can be done in-browser, I strongly encourage students to use a code editor (I use Atom but my course assistant prefers PyCharm’s community edition) and Github desktop to work offline so they don't lose work due to connectivity issues. There are a myriad of ways to set up a local Python environment for students: I have found Anaconda to be relatively straight forward and it includes a version of Jupyter Notebooks that runs locally, but uses a web browser as an interface.

I recommend instructors survey their students before class to ensure their computing environment and connectivity won’t pose any problems. The end of this README provides links to sample survey questions and a Google form that you can copy and adapt for this purpose.

To complete these activities students will need:

  • a Github account (I recommend the student developer pack) for receiving assignments and sharing code,
  • a Google account, and
  • a version of Python 3 running locally in the event that they cannot access Colab.

Contents & Delivery of Activities

The fundamental text for this course is Think Python, 2nd edition by Allen Downey. This is a widely used text that, itself, contains further exercises that can be incorporated into your class. Because the text is released under open-source license, it is available free of charge and can be accessed as either a .pdf file or as HTML.

There are six folders in this repository labeled in chronological order according to the week in which they are delivered (e.g. Week_1). Each week consists of two lecture sessions and one lab. Lectures expand concepts from the book and provide students with an opportunity to code along with the instructor. The lab sessions provide students with guidance for a basic piece of code, which they complete on their own. Using Github and formatting documentation using Markdown are addressed in some of the lectures along with resources for practice or learning more. Additionally, some weeks include more complicated coding assignments or writing assignments about coding, technology, or related topics.

I began using slides for lectures but quickly moved to using a Colab notebook open in a browser, which is vastly more intuitive for students to use since they didn’t have to try and copy code from a slide into a code editor. It also made managing my desktop during lecture much easier! I’ve included both .pdf versions of my PowerPoint slides and the Colab notebooks in this repo, the latter will be the most useful. You can start up the notebooks right away and start coding. Some of the lecture slides, however, reference a lot of the international development / humanitarian examples pulled from my professional experience: I’ve included them here mostly for context.

I release each lab as a stand-alone Github repository that students clone or fork into their personal Github account from which to work. The first lab is a writing assignment to get them familiar with articulating technical concepts and ideas about open-source technology, git, and the role of coding in humanitarian affairs or international development. The remaining lab repositories contain instructions for completion in the README file. Some labs are accompanied by a starter .py file that indicates a standard comment block as a starting point, while other labs contain only the readme file. To submit labs (or related assignments) students edit the README files to answer basic questions about the labs or share their thoughts, ensure their well-commented .py file is in the repo, and submit a link to the repo. In some classes I’ve used Github Classroom to manage this, which doesn't require a URL submission. The lab folders in this repo contain sample solutions in an Colab notebook.

By using this workflow, students learn the basics of coding in Python while concurrently learning to document and share code. At the end of the course, students also have online examples of their work in an industry-standard environment.

Exam & Final Project

Aside from lectures and labs, I include one exam and a final project as part of the course. The exam provides a variety of basic code snippets and asks students to complete them, debug them, or explain what the output will be. The final project requires submission of 2 pieces of code: one is an expanded lab assignment, the other can either be a project they want to try, or a reworked lab (e.g. using different values, combining two labs to generate new output, etc.). Because this course is a 6 module, students with no coding experience generally don’t have enough time to really develop a full project and choose to rework labs. Students who come to the course with some coding will often have a better sense of a personal project that they would like to complete.

What's next?

This class is a six-week module that is followed by another module called "Computer Programming for GIS" and you can find the exercises I use for that class in this repo.

Philosophy of the Course

It may be helpful to understand how these activities fit into the larger scheme of my courses. I teach web mapping and GIS in the context of humanitarian affairs. This means that not all students will go on to become web developers or GISers and may instead (or also!) become program officers in humanitarian organizations. The primary goal of my courses is to teach how technology works and how geography or concepts of “humanitarianism” or “international development” can be mediated by it. My courses include lectures, readings and discussions on software development, licensing, diversity and inclusivity, low-connectivity environments, the digital divide, and the structure of humanitarian programs. I also introduce students to critical GIS and the emerging “Digital Geographies” conversation (book here | AAG specialty group here). In some courses, I introduce activities about Human Centered Design and place an emphasis on understanding user needs. I challenge students to constantly, and critically, evaluate technology and ask who it is meant to serve, who it actually serves, and why.

Understand Student Access to Technology & Associated Risks

I watched professors and instructors from all disciplines transition to online teaching in response to the widespread lockdowns and university closures of the 2020 Coronavirus Pandemic with mixed emotions. While I was glad to see so many of them making an extremely valiant efforts, I was also disheartened to see how many of them assumed they would continue to deliver their classes online without any thought to how variable Internet access may be among their students. Nor did I see any of them really consider risks or threats to privacy that their students might be dealing with as a result of the switch to online learning. I wrote this blogpost to provide instructors with a background about why they needed to understand their student’s access to technology and supplied these draft survey questions and form that can be modified for this purpose.

Please familiarize yourself with the relevant national, state, and institutional policies that govern how student privacy should be protected online. In the U.S., the Family Educational Rights and Privacy Act (FERPA) is a great place to start. Two other great resources for you and your students are the toolkit for online surveillance self-defense from the Electronic Frontier Foundation and “Security in a Box” from the Tactical Technology Collective. I’ll update this repo with more resources for online safety and privacy as I find them.

References / Citations / Credits

These activities were created as part of my “Introduction to Python” and “Introduction to Computer Programming for GIS” courses at Clark University’s Department of International Development, Community, and Environment. My course assistant Priyanka Verma also contributed heavily to these materials and did a phenomenal job of helping me streamline a workflow for delivering the course. As stated, the course relies heavily on work by Allen Downey. Additional readings are linked within each week’s repo. All links work as of 16 July 2020, but should be checked periodically.

The license for this repo is CC-BY-SA-4.0, so feel free to use or adapt all of this material in your class or training program! Please contribute via pull request or get in touch with me at shadrock.roberts@gmail.com.

About

Activities for teaching Python online, taken from my IDCE 302 course at Clark University

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published