Python Basics

by Elliott Hauser

17 May 2018

Quick Intro

tl;dl: Coding should be fun! Do lots of it and you’ll get good at it. Don’t cheat, pay attention, be on time.

  • My bio
  • My stance on Honor
  • My pay attention policy
  • My late policy
  • The benefits and challenges of our accelerated Summer schedule
  • Questions for me?
  • Some questions for you are in the welcome form you’ll fill out today
  • Basic orientation to website

Read the syllabus and feel free to email me with any questions or concerns.

Why this class is cool:

  • You will make games and command line scripts with Python
  • You will submit and merge pull requests on github (an important professional skill!)
  • You will use several languages besides Python including YAML, Markdown, and HTML
  • You will feel confident and be effective a learning new things
  • You will learn problem solving strategies and attitudes that will serve you well in any career

Why Python is Cool

Cool interactive animations:

Interactive Games:

Data Viz:

But programs can also be very simple, and we’ll start simple.

Your First Python Program

Programs are composed of small pieces. In this class you’ll learn about the pieces and then put the pieces together to form more and more complex programs. Our first in-class exercise will take you from drawing a simple line to making more complex drawings. This will prepare you for your first homework, which is to use what we learn in class and online resources to make a drawing.

Todos

These will be on the assignments page, but I wanted to make sure everything was clear for the first day.

We should have plenty of time in class to do these, but anything you don’t finish, complete by midnight tonight:

  • Sign up for Trinket. You’ll need a premium Trinket account by the 2nd week of class. Use code inls560rocks for 50% off.
  • In trinket, go home and click Join Class. Enter code pdq82U. ‘INLS 560 Assignments’ will now appear on your homepage (in addition to my links to it)
  • Complete and Submit the “Basics of Turtle” exercise
  • Sign up for Github
    • Make your first post to our github blog
  • Go over some Github basics
  • (hopefully) start your second post to our Github blog. You’ll have the weekend to finish this for if you need it.

Complete these by the beginning of next class:

  • Read Why Python
  • Get access to “Python Game Development for Beginners” by yours truly. I suggest a subscription to Safari Books Online. This will also give you access to a wide range of other tech resources for this class and beyond. PSA: Safari offers a 10 day free trial.
  • Read about Variables
  • Make some basic Python Programs with Chapter 2 extercises
  • Turtlehack!
  • Submit your first reflective post (on Github) about the experience of the class and exercises so far

Let’s Go!

Our first in-class exercise will have you making a cool animation with Python. I’ll stop us periodically to discuss and share your progress.

Intermission

I’ll need your Github username so I can add you to our site.

Class Part 2: Github

Now it’s time to:

  • Make your first post to our github blog
  • Go over some Github basics
  • (hopefully) start your second post to our Github blog. You’ll have the weekend to finish this for if you need it.

Let’s get going!

Last Words / Next Steps

  • A theme for programming: type and read your code closely

If you finish early:

Elliott Hauser is a PhD Student in information science at UNC Chapel Hill. He's hacking education as one of the cofounders of Trinket.io. Find Elliott Hauser on Twitter, Github, and on the web.