• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Code the Dream
Code the Dream Labs Logo

Code the Dream

At Code the Dream, we envision a world in which tech innovation comes from all of us and benefits all of us.

  • Learn
    • Our Code School
    • Courses
    • Application
    • CTD Info Sessions
    • Student Showcase
    • Apprenticeship
  • Apprenticeship
    • Registered Apprenticeship
  • Volunteer
    • Volunteer Opportunities
    • Become a Volunteer
  • Hire
    • Employer Partnerships
    • Tandem Apprenticeship
    • Become an Employer Partner
  • About
    • About Code the Dream
    • Mission, Vision, and Values
    • Meet the Team
    • Board of Directors
    • News
    • Job Opportunities
    • Contact Us
  • CTD Labs
  • Donate
  • Build With Us
    • Mobile Apps
    • Web Apps
    • Websites
    • Design
    • Build With Us
  • Our Work
    • Portfolio
    • Apps for Nonprofit Use
  • About CTD Labs
  • Code the Dream Home

Search Code the Dream

Python Intro Pre-Work

Complete your application for Code the Dream’s Python Intro course by submitting pre-work. The pre-work is designed to show us that you can follow a technical process from beginning to end, and to give you a realistic sense of what our classes are like. You do not need any prior coding experience.

The boxes below display a quick overview of the assignment tasks. For more details, scroll down the page.

Assignment Instructions

Review these steps and complete your assignment.

1
2
3
4
Task 1

Python Script

Create a short Python script. Your code must include:

Two variables that come from user input. Use the input() function twice and store each answer in its own variable.
A conditional (if/else, with elif optional) that tests one of the values the user entered. This is what makes your output change.
At least one print statement that uses two of your variables.
At least one number used somewhere in your script. This can be a number you write directly in your code, or one of the user’s answers converted with int() or float().
A comment at the top saying what the script does and what it asks the user for. Comment lines start with #.
Two example runs documented at the bottom

See Task 1: Python Script for more details.

It’s okay if any of these concepts are unfamiliar to you! Complete Unit 1 and Unit 2of Khan Academy’s Intro to Computer Science module to prepare for Task 1. The Khan Academy modules take between 1-2 hours to complete.

Task 2

Spreadsheet Practice

Make a copy of this Google Sheets spreadsheet and complete the following:

Enter your name in the Name cell.
In the Year Average High column, add a formula that calculates the average high temperature for each city. Use a spreadsheet formula such as =AVERAGE(...). Do not calculate the averages yourself and type in the results.
In the Highest Year Average High cell, add a formula that returns the largest value in the Year Average High column.
In the Lowest Year Average High cell, add a formula that returns the smallest value in the Year Average High column.
In the Description cell, write one or two sentences describing what this data shows and one specific thing you noticed in it.

Download the spreadsheet as a .csv file and attach it to your pre-work submission form. Save it as CTD_prework_yourname.

If you don’t feel comfortable with Google Sheets, check out W3 Schools’ Google Sheets tutorial. You don’t need to complete the entire tutorial — look at the sidebar for specific subsections (AVERAGE, for example).

Task 3

Save Your Work on GitHub

Go to github.com and sign up for a free account if you don’t already have one.

1. Create a repository and name it ctd_prework.
2. Upload your .py and .csv files.
3. Get your repository link and share in the pre-work submission form.

Task 4

Submit the Pre-Work Submission Form

Once you have your .py and .csv files saved to your computer, use the form below to submit your work.
In the submission form, you will also answer two questions in each of three sections: Problem Solving, Computer Setup & File Navigation, and Asking for Help. Completing the form may take 20-30 minutes. Read instructions carefully and answer the questions as best as you are able.


Optional Task: Khan Academy Python Tutorial

If you are new to coding, we suggest you do Units 1 and 2 of Khan Academy’s Intro to Computer Science course before attempting the pre-work assignment. Code the Dream uses the flipped classroom model, where you learn most new material at home, then practice it in live group mentor sessions. The following tutorial from Khan Academy is a good way to get used to the self-study-first approach.

  1. Sign up for a free Khan Academy account.
  2. Complete Units 1 and 2 only of the Intro to Python Fundamentals course. Unit 1 covers variables and data types. Unit 2 covers conditionals.

We estimate this tutorial will take 1-2 hours. This step is optional – we will not see your progress, and if you already feel confident with Python, you may do Task 1 on your own.

Task 1: Python Script

Below is a video overview of the Python Script task. This video uses an age verification script to demonstrate the code. This is just an example — please use your own script idea and your own variables.

If any of the terms in this section are unfamiliar to you, reference the optional Khan Academy tutorial above.

Note: You are allowed use AI to check your code for errors. But do not enter the prompt into an AI tool to generate your code from scratch. You will learn nothing from doing this.

Where to write your code

You will use Google Colab, a free tool that runs Python in your web browser. You do not need to install anything, and your work saves automatically as you go.

  1. Go to colab.research.google.com and sign in with your Google account.
  2. Click New notebook.
  3. You will see one empty box that reads “start coding”. This is called a cell.
  4. Type your whole script into that one cell. Do not split it across several cells.
  5. Click the play button to the left of the cell to run your script. The first run takes a few seconds to start up.
  6. When your script asks a question, a text box appears below the cell. Type your answer there and press Enter.

Your notebook saves to your Google Drive automatically, so you can close the tab and come back to it later.

What your script will do

Write a Python script that asks the user for two pieces of information, then prints a message that changes depending on what the user typed.

A program is useful because its output responds to user input. If your script prints the same message no matter what the user inputs, it is not a useful program. For example, a program that asks, “What is your name?” and then responds, “Hello [name], your favorite color is blue” is not useful, even if “blue” is a variable. Not everyone’s favorite color is blue!

Requirements:

Confirm that your code contains all of the following:

  • Two variables that come from user input. Use the input() function twice and store each answer in its own variable.
  • A conditional (if/else, with elif optional) that tests one of the values the user entered. This is what makes your output change.
  • At least one print statement that uses two of your variables.
  • At least one number used somewhere in your script. This can be a number you write directly in your code, or one of the user’s answers converted with int() or float().
  • A comment at the top saying what the script does and what it asks the user for. Comment lines start with #.
  • Two example runs documented at the bottom (see below).

Hint: input() always returns text, even when the user types a number. If you want to compare or calculate with a number the user entered, convert it first with int() or float().

Test your script before submitting:

Run your script twice, entering different answers each time. Then add both runs as comments at the bottom of your file, in this format:

Start every one of these lines with #, including the Inputs and Output lines. The # tells Python to ignore the line. Without it, Python tries to run your notes as code and your script stops with an error.

# Example run 1
# Inputs: Maria, dog
# Output: Hi Maria, dogs make wonderful pets!

# Example run 2
# Inputs: Sam, snake
# Output: Hi Sam, I have never met a snake.

The outputs of your two runs must be different from each other. If they are the same, your conditional is not testing a value the user entered. Go back and fix that before you submit.

Your script must run without errors when we test it.

Download your script as a .py file

In Task 3, you’ll upload your Python script to GitHub so we can review it.

  1. In Google Colab, select File on the menu bar.
  2. Navigate to Download, then Download .py
  3. Rename your .py file to CTD_prework_yourname.py, replacing yourname with your own name. For example: CTD_prework_maria.py.
  4. Remember where you saved your file. You’ll access this again in Task 3.

Task 2: Spreadsheet Practice

Optional Tutorial: W3 Schools Google Sheets

If you are new to spreadsheet tools like Google Sheets or Microsoft Excel, you can use the W3Schools Google Sheets tutorial as a reference. You do not need to register or complete the whole tutorial. The “Formulas” and “Functions” sections are the relevant ones.

Complete the spreadsheet

Make a copy of this Google Sheets spreadsheet. In the Google Sheet template, cells you work in are highlighted yellow:

  1. Enter your name in the Name cell.
  2. In the Year Average High column, add a formula that calculates the average high temperature for each city. Use a spreadsheet formula such as =AVERAGE(...). Do not calculate the averages yourself and type in the results.
  3. In the Highest Year Average High cell, add a formula that returns the largest value in the Year Average High column.
  4. In the Lowest Year Average High cell, add a formula that returns the smallest value in the Year Average High column.
  5. In the Description cell, write one or two sentences describing what this data shows and one specific thing you noticed in it.

Download your spreadsheet as a CSV file

In Task 3, you’ll upload your spreadsheet to GitHub so we can review it.

  1. In Google Sheets, click File, then Download, then Comma Separated Values (.csv).
  2. Rename the downloaded file to CTD_prework_yourname.csv, replacing yourname with your own name. For example: CTD_prework_maria.csv.
  3. Remember where you saved your file. You’ll access it again in Task 3.

Task 3: Save Your Work on GitHub

Next, you’ll save your work on GitHub, a platform where developers save and share code.

This video walks you through the following steps. It’s okay if you’re new to GitHub — follow these steps and you will have a repository to share.

Step 1 — Create a GitHub account (skip this step if you already have one)

Go to github.com and sign up for a free account.

Step 2 — Create a repository

A repository is a folder for your project on GitHub.

  1. Once logged in, click the + icon in the top-right corner and select New repository.
  2. Name it ctd-prework.
  3. Make sure Public is selected.
  4. Toggle Add a README to ON.
  5. Click Create Repository.

Congrats, you’ve created your first GitHub repository! If your next screen doesn’t look like the empty repository in the video, make sure you clicked “add a README.”

Step 4 — Upload your .py and .csv files

  1. Click Add file > Upload files.
  2. Drag your CTD_prework_yourname.csv and CTD_prework_yourname.py files onto the page, or click choose your files to find it.
  3. Click Commit changes.

Step 5 – Check your work

Go to the main page of your repository. Before you continue, confirm all of the following:

  • The repository is named ctd-prework.
  • It says Public next to the repository name.
  • It contains three files: README.md, your .py file, and your .csv file.
  • Clicking the .py file shows your Python code.

Step 6 — Get your repository link

  1. Copy the URL of your repository. It will look something like (https://github.com/your-username/ctd-prework).
  2. Be ready to paste the URL into the submission form below.

Task 4: Submit Your Work

Check submission deadlines (and result dates) for each class term here.

Complete the submission form below. Once you select which class you are applying for, additional questions and instructions will appear.

The form has four parts. One part asks for your GitHub repository URL. The others ask about problem solving, computer setup, and asking for help. These three are essential skills for succeeding in our classes, and each part of the form includes guidance and resources in case you are new to coding. Read the instructions in the form carefully and answer as best you can. Here is what to expect:

Problem-Solving:

  1. Share a screenshot showing that you know how to open the developer tools in your web browser.
  2. Describe, step by step, how to get from the start point to the end point of a flowchart we provide.

Computer setup and file navigation:

  1. Identify which computer and operating system you are using.
  2. Create a folder on your desktop, download a file into that folder, and share a screenshot showing that you completed the task.

Asking for help.:

  1. Look at a screenshot of an error message and describe what you learn from it. We do not expect you to fully understand the error. Just share what you notice.
  2. Using a template we provide, write an example message asking a mentor for help with a coding problem.

Submit the your pre-work using the form below.

We look forward to seeing you in class!

Footer

Code the Dream logo

Copyright © 2026 Code the Dream | All Rights Reserved | Privacy Policy