import import streamlit as st
import math
# Title of the app
st.title("Pipe Volume Calculator")
# Input fields for dimensions
inner_diameter = st.number_input("Enter the inner diameter of the pipe (in meters):", min_value=0.0, format="%.2f")
outer_diameter = st.number_input("Enter the outer diameter of the pipe (in meters):", min_value=0.0, format="%.2f")
length = st.number_input("Enter the length of the pipe (in meters):", min_value=0.0, format="%.2f")
# Calculate the volume
if st.button("Calculate Volume"):
if inner_diameter > 0 and outer_diameter > 0 and length > 0:
inner_radius = inner_diameter / 2
outer_radius = outer_diameter / 2
volume = math.pi * (outer_radius**2 - inner_radius**2) * length
st.success(f"The volume of the pipe is {volume:.2f} cubic meters.")
else:
st.error("Please enter valid dimensions greater than zero.")streamlit as st
import math
# Title of the app
st.title("Pipe Volume Calculator")
# Input fields for dimensions
inner_diameter = st.number_input("Enter the inner diameter of the pipe (in meters):", min_value=0.0, format="%.2f")
outer_diameter = st.number_input("Enter the outer diameter of the pipe (in meters):", min_value=0.0, format="%.2f")
length = st.number_input("Enter the length of the pipe (in meters):", min_value=0.0, format="%.2f")
# Calculate the volume
if st.button("Calculate Volume"):
if inner_diameter > 0 and outer_diameter > 0 and length > 0:
inner_radius = inner_diameter / 2
outer_radius = outer_diameter / 2
volume = math.pi * (outer_radius**2 - inner_radius**2) * length
st.success(f"The volume of the pipe is {volume:.2f} cubic meters.")
else:
st.error("Please enter valid dimensions greater than zero.")