Name:

Date:

 

 

Lab 6 - Programming with Python

Evolution and Learning in Computational and Robotic Agents
MSE 2400   Dr. Tom Way

Introduction

Worth

Due

Lab Steps

Part 1 - Why Write Code?

  1. Go to Code.org and watch the video. (We may watch this as a class.)

Part 2 - Hour of Code

  1. Go to the Hour of Code on the Code.org page. Watch the introductory video.
  2. Complete all 20 puzzles.
  3. Demonstrate your results to the instructor or TA and acquire his or her initials here: ____________
  4. ALTERNATIVE TO INITIALS: If you do this work on your own, briefly describe here in writing what you did and what you learned:



 

Part 3 - Flappy Code

  1. Go to the Flappy Code project on Code.org. Watch the introductory video.
  2. Complete all 10 puzzles.
  3. Demonstrate your results to the instructor or TA and acquire his or her initials here: ____________
  4. ALTERNATIVE TO INITIALS: If you do this work on your own, briefly describe here in writing what you did and what you learned:

Part 4 - Lightbot

  1. Go to the Lightbot project on Code.org.
  2. Complete all the puzzles in Basics, Procedures and Loops.
  3. Demonstrate your results to the instructor or TA and acquire his or her initials here: ____________
  4. ALTERNATIVE TO INITIALS: If you do this work on your own, briefly describe here in writing what you did and what you learned:

     

Part 5 - Gaining mad skills in Python

  1. Go to Computer Science Circles (http://cscircles.cemc.uwaterloo.ca/) and create a free account.
  2. Complete the following lessons:
  3. Demonstrate your results to the instructor or TA and acquire initials here: ____________
  4. ALTERNATIVE TO INITIALS: If you work through this tutorial on your own, briefly describe here in writing what you did and what you learned:

Part 6 - Verify that Python is Installed

  1. In this lab and Lab 7, you will use the IDLE Python editor. Make sure it is installed on your laptop. If it isn't installed, follow the instructions for installing Python and NLTK here.

Part 7 - Writing your first program

  1. Open IDLE and write a "hello world" program.
  2. Run the program (which means you need to save it first).
  3. Demonstrate your "hello world" program to the instructor or TA, and acquire initials here: __________
  4. ALTERNATIVE TO INITIALS: If you do this work on your own, briefly describe here in writing what you did and what you learned:

Part 8 - Understanding an existing program

  1. Download and save the numberguess.py program file. Alternately, you can copy it and paste it into a new document in IDLE.
  2. Download and save in the same folder the insults.txt file for use with the program.
  3. Open the program in IDLE and run it.
  4. Add comments to the program (a line starting with the "#" character indicates a comment) that describe what various lines or sections of code are doing. After adding comments, make sure the program still works correctly by saving it and running it again.
  5. Modify the insults.txt file by adding more insults or even making the "insults" more positive rather than negative.
  6. Save the revised program and insults file, and show them to the instructor or TA, and have them sign their initials here: __________
  7. ALTERNATIVE TO INITIALS: If you do this work on your own, briefly describe here in writing what you did and what you learned: