Created
May 8, 2014 00:17
-
-
Save samueltcsantos/08ac0c88d1c966f65615 to your computer and use it in GitHub Desktop.
Algoritmo para calcular o volume e a área de uma esfera.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
#------------------------------------------ | |
# Autor: Samuel T. C. Santos | |
# Data: 07/05/2014 | |
# python version-2.x | |
#------------------------------------------ | |
import math | |
raio = raw_input("Raio? ") | |
# V= 4/3*pi*r^3 | |
volume = 4/3 * math.pi * math.pow(float(raio),3) | |
# A = 4 * pi*r^2 | |
area = 4 * math.pi * math.pow(float(raio),2) | |
print "Area = %.2f" % area | |
print "Volume %.2f" % volume |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
boa