Exam 1_Spring 2011

6 write for loop based python code to do the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ws the axis aligned rectangle for which those two points are in opposing corners and marks the center of the rectangle with a dot. 6. Write for loop based Python code to do the following: (a) Print out the multiples of 6 from 600 to 660 inclusive. Note: The first thing printed will be 600 and the last thing printed will be 660. (b) Print the following output: Train Train Train Train Train Train Train Train 1 2 3 4 5 6 7 8 arrives arrives arrives arrives arrives arrives arrives arrives in in in in in in in in 5 minutes. 25 minutes. 53 minutes. 15 minutes. 21 minutes. 18 minutes. 32 minutes. 2 minutes. 7. Write a Python graphics based program that requires the user to click on two points in its window, thereby defining a circle and one of its radii. The program then draws both the circle centered on the first point and the radius between the two points. 6 8. Trace the following Python code, i.e. indicate the state of the variables as they change and what output is printed to the screen: (a) f=1 s=3 for i in...
View Full Document

This document was uploaded on 03/24/2014 for the course CMP 230 at Lehman College.

Ask a homework question - tutors are online