My first real program in python, so probably needs a lot of work. I've been taking a class and it's really slow and I was self taught most over past 2 weeks. Anything I should do differently?
#Programmer: Delirious Mistakes
#Date: October 7, 2015
#File: Advanced Shape Calculator V1
#This file will calculate the measurements of the shapes.
from __future__ import division
import time
import math
#creates a function for the area
def Area_R(num1, num2):
return (1.0 / 4.0) * num1 * (num2 ** 2.0) * (1.0 / math.tan(math.pi / num1))
#num1 = number of sides,,, num2 = measure of side
#creates a function for the perimeter
def Perm_R(num1, num2):
return num1 * num2
def main():
print "Welcome to my Advance Shape Calculator V1!"
time.sleep(.7)
repeat = "d"
print "Please answer questions using the choices (A, B, C, etc.)"
time.sleep(2.1738)
while repeat != "Quit" and repeat != "quit" and repeat != "b" and repeat != "B" and repeat != "no" and repeat != "No":
print "A) Round Edges"
print "B) Straight Edges"
Edges1 = raw_input("Does the shape have round edges or straight edges?: ")
if Edges1 == "a" or Edges1 == "A" or Edges1 == "Round Edges" or Edges1 == "round edges":
print "A) Circle"
print "B) Semi-Circle"
Circle = raw_input("Is it a circle or semi-circle?: ")
if Circle == "A" or Circle == "a" or Circle == "Circle" or Circle == "circle":
radius_C = input("What is the radius (1/2 of the Diameter)?: ")
Area_C = math.pi * radius_C ** 2.0
Circum_C = 2.0 * math.pi * radius_C
Diameter_C = 2.0 * radius_C
print "The radius is " + str(radius_C) + ". "
time.sleep(.5)
print "The diameter is " + str(Diameter_C) + ". "
time.sleep(.5)
print "The circumference is " + str(round(Circum_C, 2)) + ". "
time.sleep(.5)
print "The area is " + str(round(Area_C, 2)) + ". "
time.sleep(5)
elif Circle == "B" or Circle == "b" or Circle == "Semi-Circle" or Circle == "semi-circle":
radius_S = input("What is the radius (1/2 of the Diameter)?: ")
Area_S = math.pi * radius_S ** 2.0 * .5
Diameter_S = 2 * radius_S
Per_S = ((math.pi * 2 * radius_S) / 2) + Diameter_S
print "The radius is " + str(radius_S) + ". "
time.sleep(.5)
print "The diameter is " + str(Diameter_S) + ". "
time.sleep(.5)
print "The perimeter is " + str(round(Per_S, 2)) + ". "
time.sleep(.5)
print "The area is " + str(round(Area_S, 2)) + ". "
time.sleep(5)
else:
print "Incorrect input."
elif Edges1 == "b" or Edges1 == "B" or Edges1 == "Straight Edges" or Edges1== "straight edges":
sides = input("How many sides does the shape have?: ")
sideL = input("What is the length of 1 side?: ")
Area = round(Area_R(sides, sideL), 4)
Perim = round(Perm_R(sides, sideL), 4)
print "The area of this figure is: " + str(Area)
print "The perimeter of the figure is: " + str(Perim)
else:
print "Incorrect input."
time.sleep(4)
print" "
print" "
print "A) yes"
print "B) No"
repeat = raw_input("Want to try another?: ")
time.sleep(1)
main()
# ___ ___ ___ ___ ___ ___ ___
# /\ \ /\ \ /\__\ ___ /\ \ ___ /\ \ /\__\ /\ \
# /::\ \ /::\ \ /:/ / /\ \ /::\ \ /\ \ /::\ \ /:/ / /::\ \
# /:/\:\ \ /:/\:\ \ /:/ / \:\ \ /:/\:\ \ \:\ \ /:/\:\ \ /:/ / /:/\ \ \
# /:/ \:\__\ /::\~\:\ \ /:/ / /::\__\ /::\~\:\ \ /::\__\ /:/ \:\ \ /:/ / ___ _\:\~\ \ \
# /:/__/ \:|__| /:/\:\ \:\__\ /:/__/ __/:/\/__/ /:/\:\ \:\__\ __/:/\/__/ /:/__/ \:\__\ /:/__/ /\__\ /\ \:\ \ \__\
# \:\ \ /:/ / \:\~\:\ \/__/ \:\ \ /\/:/ / \/_|::\/:/ / /\/:/ / \:\ \ /:/ / \:\ \ /:/ / \:\ \:\ \/__/
# \:\ /:/ / \:\ \:\__\ \:\ \ \::/__/ |:|::/ / \::/__/ \:\ /:/ / \:\ /:/ / \:\ \:\__\
# \:\/:/ / \:\ \/__/ \:\ \ \:\__\ |:|\/__/ \:\__\ \:\/:/ / \:\/:/ / \:\/:/ /
# \::/__/ \:\__\ \:\__\ \/__/ |:| | \/__/ \::/ / \::/ / \::/ /
# ~~ \/__/ \/__/ \|__| \/__/ \/__/ \/__/
# ___ ___ ___ ___ ___ ___ ___
# /\__\ ___ /\ \ /\ \ /\ \ /\__\ /\ \ /\ \
# /::| | /\ \ /::\ \ \:\ \ /::\ \ /:/ / /::\ \ /::\ \
# /:|:| | \:\ \ /:/\ \ \ \:\ \ /:/\:\ \ /:/__/ /:/\:\ \ /:/\ \ \
# /:/|:|__|__ /::\__\ _\:\~\ \ \ /::\ \ /::\~\:\ \ /::\__\____ /::\~\:\ \ _\:\~\ \ \
# /:/ |::::\__\ __/:/\/__/ /\ \:\ \ \__\ /:/\:\__\ /:/\:\ \:\__\ /:/\:::::\__\ /:/\:\ \:\__\ /\ \:\ \ \__\
# \/__/~~/:/ / /\/:/ / \:\ \:\ \/__/ /:/ \/__/ \/__\:\/:/ / \/_|:|~~|~ \:\~\:\ \/__/ \:\ \:\ \/__/
# /:/ / \::/__/ \:\ \:\__\ /:/ / \::/ / |:| | \:\ \:\__\ \:\ \:\__\
# /:/ / \:\__\ \:\/:/ / \/__/ /:/ / |:| | \:\ \/__/ \:\/:/ /
# /:/ / \/__/ \::/ / /:/ / |:| | \:\__\ \::/ /
# \/__/ \/__/ \/__/ \|__| \/__/ \/__/