awacke1 commited on
Commit
11fa257
·
1 Parent(s): fc5d051

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ # Function to calculate calories burned during swimming
4
+ def calories_swim(time_hr, speed_mph):
5
+ METS = 10 # Metabolic Equivalent for swimming
6
+ weight_kg = 175 * 0.453592
7
+ return (time_hr * METS * 3.5 * weight_kg) / 200
8
+
9
+ # Function to calculate calories burned during pull-ups
10
+ def calories_pullup(weight, reps):
11
+ # 1 calorie per 2.20462 pounds lifted per meter (estimated)
12
+ calories_per_pullup = (weight * 0.453592) * 2 / 2.20462
13
+ return calories_per_pullup * reps
14
+
15
+ # Streamlit UI
16
+ st.title("Calories Burned Calculator 🏊‍♂️💪")
17
+ st.sidebar.header("Input Parameters")
18
+
19
+ # Swimming parameters
20
+ time_swim = st.sidebar.slider("