Press Spacebar to continue

Marshall Brain – Computer tour, http://videos.howstuffworks.com/howstuffworks/23-computer-tour-video.htm
5 Minutes with Python - A Video Series
Press Spacebar to continue

Press Spacebar to continue
Press Spacebar to continue
def main(): dollars = input("Enter the amount of dollars: ") exchangeRate = input("Enter the current exchange rate: ) euros = dollars * exchangeRate print dollars, "Dollars = ", euros, "Euros" main()
Press Spacebar to continue
Statements that begin with # are comments - read and understood only by humans # File: Chaos.py # A simple program illustrating chaotic behavior A Python program has a function named main () in it.
That is where execution beginsdef main(): After a : statements are indented. Python uses a block structure
The above is definition of main(), and the next statement actually
A print statement causes the string enclosed in "s to be sent to
the output device
print "This program illustrates chaotic function"
An input statement sends the string in ( and "s ) to the output device Waits for the user to enter something with the input device and stores the value in the variable whose name is on the left. x = input("Enter a number between 0 and 1: ") We can assign a variable a value using =
y = 0
The for statements sets up a repetition or loop. The statements that are repeated are in a block. Note the use of : and indentation again. This one is a loop that is executed 10 times. The values of i are 0,1,2,...,9 Here they are only used for counting for i in range(10):
In this and every assignment statement, the expression on right is evaluated and the value is stored in the variable whose name is on the left x = 3.9*x*(1-x)
Here the values stored in x and y are sent to the output device. First x and then y print x, x - y
Now the value stored in x is copied to the location whose name is y y = x
informs the language system to start executing the instructions therein.main()
Press Spacebar to continue
Write a program that converts kilometers to miles.
When these last two steps are approved by me (bring your design to the front of the room.)
Then develop code, and go to lab to enter the code
Test the program.
Send me a copy of the completed program
Kevin Kelly: Predicting the next 5,000 days of the web, http://www.ted.com/index.php/talks/kevin_kelly_on_the_next_5_000_days_of_the_web.html
Press Spacebar to continue
