Regular Polygon and Circle Area Calculator

This will allow you to find the approximate area of several regular polygons and circles.

import math a = float(input("Please enter what regular polygon you want to find the area of. Options area a circle, equilateral " "triangle, square, pentagon, hexagon, octagon")) b = float(input("Please enter side length or radius of your polygon")) if a == "circle": print(3.1415 * b * b) elif a == "triangle": print(b * b * 0.433) elif a == "square": print(b * b) elif a == "pentagon": print(1.72 * b * b) elif a == "hexagon": print(2.598 * b * b) elif a == "octagon": print(4.828 * b * b) else: print("Sorry, either your polygon or length/radius is wrong")

Triangle Checker

This code will allow you to find if your triangle is equilateral, isosceles, scalene, acute, obtuse, or/and right!

Angle_A = float(input("Please enter value for angle 1 of a triangle")) Angle_B = float(input("Please enter value for angle 2 of b triangle")) Angle_C = float(input("Please enter value for angle 3 of c triangle")) if Angle_A + Angle_B + Angle_C != 180: print("Sorry, the angles you entered are not valid, please try again.") elif Angle_A > 90 or Angle_B > 90 or Angle_C > 90: print("Your triangle is Obtuse") elif Angle_A == 90 or Angle_B == 90 or Angle_C == 90: print("Your triangle is a Right triangle") elif Angle_A < 90 and Angle_B < 90 and Angle_C < 90: print("Your triangle is acute") elif Angle_A == Angle_B or Angle_B == Angle_C or Angle_A == Angle_C: print("Your triangle is isosceles") elif Angle_A != Angle_B != Angle_C: print("Your triangle is scalene") elif Angle_A == Angle_B == Angle_C: print("Your triangle is equilateral")
1