Unformatted text preview: for n in range(10, 100, 10):
for n in range(10, 100, 10):
main() 10. Write a complete program that uses a loop to help ask the user for the quantity and cost of each of
10 items. The program should then print out the total cost.
An example run of the program should look like:
Item 10: -> 3
-> 5 2 Enter quantity -> 6
Your total cost is: 201.18 3 Lehman College, CUNY CMP 230 Exam 1, Version 1 Spring 2011 1. Write Python code that prompts the user for the diameter of a circle, and prints out the circumference
of the circle. Useful formulas: circumf erence = π · diameter
2. Trace the Python code below, i.e. indicate the state of the variables as they change.
mon = 7
tue = (mon + 6)
tue = tue + 3
wed = mon % 4
thu = mon ** 2
View Full Document
This document was uploaded on 03/24/2014 for the course CMP 230 at Lehman College.
- Fall '13