OneCompiler

...and i'm just starting

230

import math
print ("Which figure do you want to calculate its area and more fun things?")
print (" ")
print ("If Square, input 1, If rectangle, input 2, if triangle, input 3, if regular polygon, input 4")

figura = int(input())

if (figura) == 1:
print (" ")
print ("How much does any of its sides measure?")
ladocuadrado = int(input())
print (" ")
print ("Then its area is:")
print (ladocuadrado**2)
print (" ")
print ("and its perimeter is equal to:")
print (ladocuadrado*4)
print (" ")
print ("Do you want to calculate another figure's area and perimeter?")
print (" ")
print ("If you want to calculate another figure, clear input and output")

elif (figura) == 2:
print (" ")
print ("How much does their sides measure? Introduce them in two different rows")
ladorectángulo1 = int(input())
ladorectángulo2 = int(input())
print (" ")
print ("OK, let's calculate its area and perimeter")
print (" ")
print ("Its area is")
print (" ")
print (ladorectángulo1ladorectángulo2)
print (" ")
print ("And its perimeter is:")
print (" ")
print (ladorectángulo1
2+ladorectángulo2*2)

elif (figura) == 3:

print (" ")
print ("Do you know how much does its base measure and how tall it is? Input 1 for yes, 2 for no.")
sino1 = int(input())
if (sino1) == 1:
print (" ")
print("OK, now, firstly, introduce via the input box its height and then, in another row, its base.")
alturatriángulo = int(input())
basetriángulo = int(input())
print (" ")
print("OK, now I will calculate its area, by the way, is it a right triangle? 1 for yes, 2 for no")
triangrect = int(input())
if (triangrect) == 1:
print(" ")
print("Its area is:")
print(" ")
print((alturatriángulo*basetriángulo)/2)
print(" ")
print("And its hypotenuse is equal to:")
hypotenuse = (alturatriángulo2+basetriángulo2)
hypotenuse = math.sqrt(hypotenuse)
print(hypotenuse)
print(" ")
print("And its total perimeter is equal to:")
print(alturatriángulo+basetriángulo+hypotenuse)
if (triangrect) == 2:
print(" ")
print("Please someone kill me. How much distance is between the point where height lands at the base and the end points of the triangle, and how tall is it?")
print(" ")
print("Firstly, introduce the first distance, secondly the second, and lastly the height of the triangle")
dist1 = int(input())
dist2 = int(input())
height = int(input())
print(" ")
print("Ok, I'll do the math for you, you lazy individual")

  areatriang1 = (dist1*height)/2
  areatriang2 = (dist1*height)/2
  
  hypotenuse1 = math.sqrt(dist1**2+height**2)
  hypotenuse2 = math.sqrt(dist2**2+height**2)
  perimeter = hypotenuse1+hypotenuse2+dist1+dist2
  
  print(" ")
  print("Ok, I have it,")
  print(" ")
  print("Area:")
  print(areatriang1+areatriang2)
  print(" ")
  print("Perimeter:")
  print(perimeter)
  

if (sino1) == 2:
print(" ")
print("Oh man, at least is it a right triangle? 1 for yes, 2 for no")
sino2 = int(input())
if sino2 == 1:
print(" ")
print("Do you know the hypotenuse and one leg, right? 1 for yes, 2 for no")
sino3 = int(input())
if sino3 == 1:
print(" ")
print("Ok, at least we are getting somewhere, insert the data in two different rows, firstly the hypotenuse and the the leg")
hypotenuse = int(input())
leg1 = int(input())
if leg1 >= hypotenuse:
print(" ")
print("Can you please enter a value that makes sense? How is it possible that the leg is greater than the hypotenuse? Look, I will do the math for you even if you are stupid OK?")
hypotenuse = 0
leg1 = 0
if sino3 == 2:
print("")
print("then ***** off, i don't wanna calculate that. i have been working with triangles for more time i would have wanted to.")

    if leg1 <= hypotenuse:
      print(" ")
    print("I will do the math for you, you stupid")
    leg2 = hypotenuse*hypotenuse-leg1*leg1
    leg2 = math.sqrt(leg2)
    print(" ")
    print("I've got it, this better be good...")
    print(" ")
    print(leg2)
    print(" ")
    print("Its area is equal to(idk how dafuck to use heron's formula, i just copy-pasted it, divide de value obtained by 2 to obtain a very approximate result)")
    print(" ")
    perimetro = leg1+leg2+hypotenuse
    semiperimetro = perimetro/2
    area = (semiperimetro*(semiperimetro-leg1)*(semiperimetro-leg1-leg2)*(semiperimetro-leg1-leg2-hypotenuse))**(1/2)
    print(area)
    print(" ")
    print("And its perimeter value is " + (perimetro))
    if leg2 <= 0:
      print (" ")
      print ("What have you done, can you PLEASE do what I tell you and to not desobey?")
    

if sino2 == 2:
  print(" ")
  print("Please someone kill me. How much distance is between the point where height lands at the base and the end points of the triangle, and how tall is it?")
  print(" ")
  print("Firstly, introduce the first distance, secondly the second, and lastly the height of the triangle")
  dist1 = int(input())
  dist2 = int(input())
  height = int(input())
  print(" ")
  print("Ok, I'll do the math for you, you lazy individual")
  
  areatriang1 = (dist1*height)/2
  areatriang2 = (dist1*height)/2
  
  hypotenuse1 = math.sqrt(dist1**2+height**2)
  hypotenuse2 = math.sqrt(dist2**2+height**2)
  perimeter = hypotenuse1+hypotenuse2+dist1+dist2
  
  print(" ")
  print("Ok, I have it,")
  print(" ")
  print("Area:")
  print(areatriang1+areatriang2)
  print(" ")
  print("Perimeter:")
  print(perimeter)
  

elif figura == 4:
print(" ")
print("What do you want to calculate? 1 for area, 2 for apothem, 3 for perimeter/radious, 4 for number of sides")

calculate = int(input())

if calculate == 1:
print(" ")
print("So you want to calculate the area eh? You will need the perimeter and apothem. Do you have them? 1 yes, 2 no.")
sino4 = int(input())

if sino4 == 1:
    print(" ")
    print("Ok, firstly introduce the apothem, then the perimeter. DO NOT MIX THEM")
    
    apothem = int(input())
    perimeter = int(input())
    
    print(" ")
    print("Ok, I will calculate this for you now, gimme a sec.")
    area = (apothem*perimeter)/2
    print(" ")
    print("Its area is:")
    print(" ")
    print(area)
    print(" ")
    print("Its radious is:")
    print(" ")
    print(apothem)
    print(" ")
    print("Do you know how many sides this regular polygon have? 1 yes, 2 no")
    
    sino5 = int(input())
    if sino5 == 1:
      print(" ")
      print("Tell me down below how many sides it has")
      n = int(input)
      if n <= 2:
        print("input a valid value please")
        
      if n >= 3:
        print(" ")
        print("Now im gonna vomit everything calculable with this")

if sino4 == 2:
  print(" ")
  print("Then cry cuz i cannot calculate that, try finding a way to calculate that.")