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(" | |