ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/learning/scndprg.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
Original Path: Python/NinoCode/learning/scndprg.py
File size: 589 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 # Area calculation program
2     print "Welcome to the Area calculation program"
3     print "---------------------------------------"
4     print
5    
6     # Print out the menu:
7     print "Please select a shape:"
8     print "1 Rectangle"
9     print "2 Circle"
10    
11     # Get the user's choice:
12     shape = input("> ")
13    
14     # Calculate the area:
15     if shape == 1:
16     height = input("Please enter the height: ")
17     width = input("Please enter the width: ")
18     area = height*width
19     print "The area is", area
20     else:
21     radius = input("Please enter the radius: ")
22     area = 3.14*(radius**2)
23     print "The area is", area