File size: 673 Bytes
11fa257
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import streamlit as st

# Function to calculate calories burned during swimming
def calories_swim(time_hr, speed_mph):
    METS = 10  # Metabolic Equivalent for swimming
    weight_kg = 175 * 0.453592
    return (time_hr * METS * 3.5 * weight_kg) / 200

# Function to calculate calories burned during pull-ups
def calories_pullup(weight, reps):
    # 1 calorie per 2.20462 pounds lifted per meter (estimated)
    calories_per_pullup = (weight * 0.453592) * 2 / 2.20462
    return calories_per_pullup * reps

# Streamlit UI
st.title("Calories Burned Calculator πŸŠβ€β™‚οΈπŸ’ͺ")
st.sidebar.header("Input Parameters")

# Swimming parameters
time_swim = st.sidebar.slider("