2014-02-25 + HW

posted Feb 25, 2014, 5:32 AM by Samuel Konstantinovich   [ updated Feb 25, 2014, 5:32 AM ]

Goal: Intro to Python


At home go to http://www.python.org/download/releases/2.7.6/ get the appropriate version of python for your computer type. This has nothing to do with the homework server. Only get python 2.7.6 (DO NOT GET version 3.x) When you choose a windows version 32 vs 64 bit matters: You can figure out what type of windows you have using:  Microsoft's automated detector 

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

Mini Lab:

  • 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: