# 2: Parts of Python

## Expectations <a href="#expectations" id="expectations"></a>

We're going to take a tour of Python. You are expected to know generally *what* these things are, you're not yet expected to know *how* to use them. So no freaking out. We'll play around with some fun projects after a quick look around.

### Learning Targets <a href="#learning-targets" id="learning-targets"></a>

* I can make a hello world app in Python.
* I can differentiate between compile-time, run-time, and logic errors.
* I can describe the basic constructs of programming languages such as variables, conditionals, loops, and flow control.

### Assessments <a href="#assessments" id="assessments"></a>

* You will be answering comprehension questions about the layers supporting software execution.
* You will be creating and submitting your several small Python apps using trinket.io

Let's go to trinket.io and build some simple stuff, starting with `print("Hello, world")`

We'll go over each of these concepts in greater detail. For now, let's skim over all the big topics.

## Class Videos

The first video deals with the following concepts:  **Functions, Variables, Operators and Conditionals**

**Class 1/4**

{% embed url="<https://youtu.be/ICU8xvAKySE>" %}
Python Material, Class 1
{% endembed %}

**Class 1/11**

{% embed url="<https://youtu.be/YZJurwkUqEM>" %}
Python Material, Class 2&#x20;
{% endembed %}

{% embed url="<https://docs.google.com/spreadsheets/d/1usadFHrr49Qjx2Lt5LcNfrzDu6XDv9qHmKRTaAZZZz4/edit?usp=sharing>" %}

**Class 1 / 20: User defined functions**

{% embed url="<https://youtu.be/TmCTpziEjgs>" %}

**class 1/24: for / while loops** &#x20;

{% embed url="<https://youtu.be/wkCKvnjk-2w>" %}

## Key Concepts

### Data Types

The first thing we'll tinker with is **declaring** variables and storing information. Variables in Python are **dynamically typed**, meaning you can store one type of information in a variable and then switch it without any fuss. Other languages are more strict and don't allow such shenanigans.

![](https://1916862645-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHmXRQJbjMi37frjOn8%2F-LKwJ-YdMjm3HGNEBRiI%2F-LKwQMm38Zu3WI3-_ii1%2Fimage.png?alt=media\&token=9456b3ad-4e53-4f13-87f4-5b843f0d6f71)

### Operators

We use math symbols for most common operations. But Python has some cool operators. Read!

{% embed url="<https://www.tutorialspoint.com/python/python_basic_operators.htm>" %}

### Conditionals

Conditionals control how the program flows based on input from the user (in an app) or sensors (on a robot.

![](https://1916862645-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHmXRQJbjMi37frjOn8%2F-LKwJ-YdMjm3HGNEBRiI%2F-LKwQEAsIh9YrHtYH4JV%2Fimage.png?alt=media\&token=7e3a3702-d0d1-4d5a-9eb2-f341e3370788)

![](https://1916862645-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LHmXRQJbjMi37frjOn8%2F-LKwJ-YdMjm3HGNEBRiI%2F-LKwQGk6hAqc8GCD_v71%2Fimage.png?alt=media\&token=6eaa8544-01ed-407f-9421-c5607afe557f)
