Week 1: Session 1

Introduction and Setup

Activity 1: Write a program on paper

Pen & paper—create set of instructions to do a task

  • Give your instructions to another group
  • Act out instructions & generalize
  • Discussion—groups explain what they did

Exercises: Write a program on paper that ....

  • Starts a car
  • Organizes socks by color
  • Makes a sandwich
  • Writes your name in secret numeric code where A=1, B=2, C=3...

Activity 2: Install Python 3 and Visual Studio Code/Create repl.it account

Setup local work environement

  • Download and Install Python 3
  • Download and Install Visual Studio Code ("Code")
  • Sign up for a free repl.it Account
  • Become familiar with the Code Editor and File Creation
  • Become familiar with the Code Terminal
  • Learn copy/paste keystrokes
  • Run python from the Terminal
  • Create a file that prints to the Console and run it in the Terminal
  • Upload a file to repl.it

Practice: Useful Editing Keystrokes for Windows

These keystrokes work on any text file in Windows.

Open sample text file.

Select all text on a page: CTRL-A

Copy to clipboard: Select text using mouse or track pad and click CTRL-C

Paste from clipboard: CTRL-V

Go to beginning of line: HOME

Go to end of line: END

Go to beginning of file: CTRL-HOME

Go to end of file: CTRL-END

Excercises:

Set up a folder to work in: projects/session-1

Open Visual Studio Code

Open the folder projects/session-1

Use CTRL-` (the backward tick character is located to the left of the 1 key and above the tab key. Use SHFT when striking this key) to open the terminal.

The Terminal is sometime called the Console and this is where Screen output goes when we execute a program from the command line that uses the Print statement.

Run code on the Command Line

Introduce Basic Computer Architecture to help understand file creation and program execution

At the Command Line, which is sometimes referred to as a CLI or Command Line Interface, type python to enter the interactive Python interpreter mode. In this interactive mode, Python will immediately process your command and return output. When you get the interpreter prompt (>>>) type the following and notice what happens.

print ("hi")

Replace ____ with your name in the following

print ("hi ____")

What is the affect of the \n

print ("hi \n My name is ___")

What is the effect of separating our output with commas?

print ("hi","\n", "My name is ____")

Is the computer really adding 1 and 1 below?

print ("1 + 1 = 2")

Running Code in a file

Go to (or open by clicking on) the main.py file your created.

Copy and paste the code you wrote on the command line above into the test.py file. Save the file.

Go to the command line and run the code in the file by typing in python main.py

What happened when you execute the code from the file?

What parts of the computer architecture are involved in running code from a file?

Activity 3: Introduce Adventure Game

Demonstrate how the games works.

Install the game on your local computer.

Run the game locally.

results matching ""

    No results matching ""