File size: 390 Bytes
2172082
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st
import math


st.title("Circle Area Calculator")


radius = st.number_input("Enter the radius of the circle:", min_value=0.0, step=0.1)

if st.button("Calculate Area"):
    if radius > 0:
        area = math.pi * radius**2
        st.success(f"The area of the circle with radius {radius} is: {area:.2f}")
    else:
        st.error("Please enter a positive radius.")