junaidshafique commited on
Commit
5326358
Β·
verified Β·
1 Parent(s): de65db1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -1,6 +1,5 @@
1
  import streamlit as st
2
  import matplotlib.pyplot as plt
3
- from datetime import datetime
4
 
5
  st.set_page_config(page_title="BMI Calculator", page_icon="βš–οΈ")
6
  st.title("βš–οΈ BMI Calculator")
@@ -38,11 +37,6 @@ def get_avg_hw(age, group):
38
  avg_height, avg_weight = get_avg_hw(age, category)
39
  st.info(f"πŸ“Š Average for {category}, Age {age}: Height β‰ˆ {avg_height} cm | Weight β‰ˆ {avg_weight} kg")
40
 
41
- # Date selector
42
- st.subheader("πŸ“… Date of Measurement")
43
- year = st.selectbox("Year", list(range(datetime.now().year, 1900, -1)))
44
- month = st.selectbox("Month", list(range(1, 13)))
45
-
46
  # Height input unit toggle
47
  height_unit = st.radio("Choose height input unit", ["Centimeters (cm)", "Feet & Inches"])
48
 
@@ -86,9 +80,8 @@ if height_m > 0 and weight_kg > 0:
86
 
87
  category_label = bmi_category(bmi, category)
88
 
89
- # Display result with date
90
- month_name = datetime(year, month, 1).strftime("%B")
91
- st.success(f"Your BMI on **{month_name} {year}** is **{bmi}** ({category_label})")
92
 
93
  # Graphical representation
94
  st.subheader("πŸ“Š BMI Category Ranges")
@@ -116,3 +109,4 @@ if height_m > 0 and weight_kg > 0:
116
  st.pyplot(fig)
117
 
118
 
 
 
1
  import streamlit as st
2
  import matplotlib.pyplot as plt
 
3
 
4
  st.set_page_config(page_title="BMI Calculator", page_icon="βš–οΈ")
5
  st.title("βš–οΈ BMI Calculator")
 
37
  avg_height, avg_weight = get_avg_hw(age, category)
38
  st.info(f"πŸ“Š Average for {category}, Age {age}: Height β‰ˆ {avg_height} cm | Weight β‰ˆ {avg_weight} kg")
39
 
 
 
 
 
 
40
  # Height input unit toggle
41
  height_unit = st.radio("Choose height input unit", ["Centimeters (cm)", "Feet & Inches"])
42
 
 
80
 
81
  category_label = bmi_category(bmi, category)
82
 
83
+ # Display result
84
+ st.success(f"Your BMI is **{bmi}** ({category_label})")
 
85
 
86
  # Graphical representation
87
  st.subheader("πŸ“Š BMI Category Ranges")
 
109
  st.pyplot(fig)
110
 
111
 
112
+