An Introduction to Python

Instructor: Matilda Asuzu

Contact: matildadigital+edu@gmail.com

Class Overview

  • Background of Python
  • Variables and Printing
  • Take Home Exercise

Who am I?

  • Started learning Python in 2015.
  • Teaching introductory Python since 2016.
  • UX Engineering Intern at Occipital
  • Use Python for Django

What to Expect

  • Code along
  • Discussion
  • Take-home exercise

What's expected

  • Please ask questions early and frequently 
  • Be prepared to answer questions in class
  • Practice and participate

Why learn Python?

Learn Python because...

  • General purpose programming language
  • Resembles English
  • Mature language
  • Interpreted
  • Large community

Let's Code!

Write Your Code Here

Variables

  • variable - a location in a computer's memory that has a name
  • value - the information stored in a variable

    Examples:
    my_variable
    my_variable = 1

Variables

Practice: Create a variable name appropriate for holding the number of students in a class.

Printing

  • Displays text output of your code
  • Useful for debugging
  • Use the print() function

    Example:
    print(my_variable)
    print("Using the print function")

Printing

Practice: Use the print() function to display the words "Hello, world".

Printing Variables

  • Useful for customizing output
  • Useful for debugging code

    Example:
    first_name = "Linus"
    print("Hello, " + first_name)

Printing Variables

Practice: Display a customized greeting using a name stored in a variable. Feel free to be creative!

Homework

Homework

Research the different types of data that can be stored in Python variables. Then write some code that stores each data type in a variable. Print each variable.

Next Class Preview

Next Class

  • Data types
  • Math and logic operators

Questions?

Intro to Python

By Matilda, digital

Intro to Python

A beginner's introduction to the Python programming language.

  • 84