This preview shows page 1. Sign up to view the full content.
Unformatted text preview: he variables as they change.
mon = 2
tue = (mon + 4)
tue = tue - 3
wed = mon % 2
thu = mon ** 3
wed = thu = mon
thu = mon - 2 *
tue = wed * mon
mon, wed = wed, %2 +2
mon 3. Write the following formulas in Python:
(a) ave = a+b+c+d
4 (b) area = 3(2 +
apothem = √ 3)side2 2area
12side 4. Write for loop based Python code to calculate:
(a) The product of all the integers from 2 to 50.
(b) 2200 .
5. Write a Python graphics based program that requires the user to click on two points in its window.
The program then draws a triangle formed by those two points and the origin.
6. Write for loop based Python code to do the following:
(a) Print out the multiples of 8 from 240 to 800 inclusive.
Note: The ﬁrst thing printed will be 240 and the last thing printed will be 800.)
(b) Print the following output:
in 2 minutes.
View Full Document
This document was uploaded on 03/24/2014 for the course CMP 230 at Lehman College.
- Fall '13