Python Workshop Session 2 [Homework Included]

Today Greg introduced us to a site named This site was where all of us could try out the new commands that Greg taught us today. During our session, he showed us how to calculate the area of a rectangle, circle, triangle and square as he was working on what we know already. He also taught us some brand new skills, like printing! We had the Python code calculate the rect_area, tri_area, etc; and then print out a statement that says “Area of the triangle is %f “ % tri_area. The %f (float) basically substitutes for the area’s value into the sentence, so the computer knows there will be a value that will be inserted there. You may only use this if your area value has a decimal value after the integer. You could also use %d, which is only used to substitute a whole numbers’ value (no decimal value after the integer). Then, the “tri_area” after tells the computer to plug in that number into the sentence.

If you aren’t fully comfortable with this new info. you can check out the code that we did today on: You can also check out this link for a refresher 

The Homework is due on 2/4/15 (OUR LAST MEETING!)

You have to……

Ask the user:

How many quarters do you have?

How many dimes do you have?

How many nickels do you have?

How many pennies do you have?

Then, calculate the amount of money they have.

Finally, print out the amount of money they have in a sentence “You have $__”

(Email us at or check out the resources above for help)


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s