Tuesday, February 1, 2011

Feb 1

#4: What I've noticed from the and and or expressions is that when using or and its only True and False then True will be the result but when you exchange True or False for a number or some other word then the result with ether be True or false or the new value you've plugged in.
#5: write a program.
#6: write a program.
#7: write a program.
#8: When I put in:
if 0:
        print "And now for something completely different..."
else:
        print "What's all this, then?"

and then i get an end result of:
What's all this, then?
from gasp import *

begin_graphics()

Box((20, 20), 100, 100)
Box((55, 20), 30, 50)
Box((40, 80), 20, 20)
Box((80, 80), 20, 20)
Line((20, 120), (70, 160))
Line((70, 160), (120, 120))

update_when('key_pressed')
end_graphics()
#10: um I haven't fully finished this one, I'm trying to understand what they meant by instead of using both the lines instead use 2 polygons. That confuses me cause when I went to the linked site openproject.net/thinkcs/python/english2e/app_b.html. Which this site describes what your suppost 2 apply when putting a polygon in, I just cant get the end result.
OK well I've now finally catch back up with chapter 5 so ill continue onto Chapter 5 tomorrow.

No comments:

Post a Comment