ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/learning/scndprg.py
Revision: 591
Committed: Tue Nov 3 22:45:12 2015 UTC (10 years, 4 months ago) by nino.borges
Content type: text/x-python
File size: 589 byte(s)
Log Message:
Moved dir out of main dir.

File Contents

# Content
1 # 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