adpkg

A package containing Python modules for mathematical, statistical, and data manipulation tasks. Features include a prime number checker, fac...

git clone https://github.com/notamitgamer/adpkg.git
· rebuilt hourlyOpen on GitHub
root / test4.py

test4.py (839B)


      1 from adpkg.triangle import areaoftriangle
      2 
      3 if __name__ == '__main__':
      4     print("--- Triangle Area Calculator ---")
      5     
      6     while True:
      7         try:
      8             side_a = input("Enter the length of side a: ")
      9             side_b = input("Enter the length of side b: ")
     10             side_c = input("Enter the length of side c: ")
     11             
     12             area = areaoftriangle(side_a, side_b, side_c)
     13             
     14             if area is not None:
     15                 print(f"The calculated area of the triangle is: {area}")
     16             
     17         except Exception as e:
     18             print(f"An error occurred during input: {e}")
     19             
     20         check_again = input("\nDo you want to calculate another area? (yes/no): ").lower()
     21         if check_again != 'yes':
     22             break
     23 
     24     print("Exiting calculator. Goodbye!")