This preview shows page 1. Sign up to view the full content.
Unformatted text preview: = thu = mon
thu = mon - 2 *
tue = wed * mon
mon, tue = tue, %2 +2
mon 3. Write the following formulas in Python:
(a) dist = (x1 − x2 )2 + (y1 − y2 )2
(b) area = √
2 side apothem = 2area
6side 4. Write for loop based Python code to calculate:
(a) The product of all the integers from 20 to 200.
(b) 5100 .
5. Write a Python graphics based program that requires the user to click on four points in its window.
The program then draws, in its window, the quadrilateral connecting these four points in the order in
which they were entered and closing at the ﬁrst and last points entered.
6. Write for loop based Python code to do the following:
(a) Print out the multiples of 7 from 77 to 700 inclusive.
Note: The ﬁrst thing printed will be 77 and the last thing printed will be 700.
(b) Print the following output:
has 30 flights.
8 flights. 7. Write a Pyth...
View Full Document
This document was uploaded on 03/24/2014 for the course CMP 230 at Lehman College.
- Fall '13