Lecture 08 + HW02*

posted Feb 11, 2013, 6:18 AM by Samuel Konstantinovich   [ updated Feb 13, 2013, 6:07 AM ]

Day 10:
Goal: Intro to Python (

REMINDER:
DO NOT SUBMIT THINGS TO THE HOMEWORK SERVER UNLESS YOU ARE TOLD TO DO SO. If you erase an old assignment it will be marked as missing, then if you replace it, it is late.
Think before you submit, did you select the correct assignment name? Are you submitting a lab that I didn’t ask you to submit? DONT DO IT!  

HOMEWORK 2*: “LINK TO PROFILE” (On the homework server)

  1. On the homework server upload a blank file and make a comment:

    1. make a comment that is a hyperlink to the home.html in your profile on bart/lisa. Eg:

      <a href="http://lisa.stuy.edu/~konstans/home.html"> Link to my profile

      </a>

    1. Before you click submit, also upload a blank file (save an empty plain text file) because the homework server does not timestamp comments without files.

  1. At home go to www.python.org and click on downloads. Get the appropriate version of python for your computer type. This has nothing to do with the homework server. Only get python 2.7.3 (DO NOT GET version 3.x)



Lecture:
Origins of the name... snake or british comedy troupe? Who makes computer languages? What would they name it after?

Development environment IDLE, allows you to edit/run code. This is a plain text editor with syntax highlighting and some cool auto complete features.

<DEMO You can log in now so you can try stuff!>

Basic Python Syntax/Concepts (play along)

  • interpretor

  • variables

  • math operations


Show an area expression using the variables Length and Width



Stuff for you to do:

  • Make a distance expression that uses variables x1,y1, x2,y2. You can assign values to them and then test your distance expression.

  • Make an expression to convert Celsius to Fahrenheit.

  • Make the reverse expression (F to C)

  • make a boolean expression for testing if a triangle is a right triangle for 3 side values A B C, assume C is the longest side.

  • Now make your expression work when you don’t assume C is the longest



ALSO! Check out some python tutorial sites:

http://www.codecademy.com

http://www.codingbat.com/python




Comments