-
Notifications
You must be signed in to change notification settings - Fork 0
/
bmic.py
77 lines (41 loc) · 1.45 KB
/
bmic.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import streamlit as st
st.title("BMI CALCULATOR")
name = st.text_input("Enter Name ")
gen = st.radio("Select Gender ",('Male','Female'))
if(gen == 'Male'):
st.success("Male")
else:
st.success("Female")
age = st.number_input("Enter Age")
add = st.text_input("Enter Address")
st.text("Select Hobbies")
if st.checkbox('Painting'):
st.text('')
if st.checkbox('Coding'):
st.text('')
if st.checkbox('Table Tennis'):
st.text('')
if st.checkbox('Cooking'):
st.text('')
if st.checkbox('Others'):
st.text('For other Hobbies type below')
st.text_input('')
weight = st.number_input("Enter Weight in Kg")
height = st.number_input("Enter Height in cms")
conv = float(height / 100)
bmi = float(weight / (conv ** 2))
if(st.button('Click here to Calculate BMI')):
st.text('Your BMI is {}'.format(bmi))
if (bmi < 18.5):
st.error(" Underweight")
link ='https://familydoctor.org/healthy-ways-to-gain-weight-if-youre-underweight/'
st.markdown(link, unsafe_allow_html=True)
elif (bmi >= 18.5 and bmi < 24.9):
st.success("Healthy")
elif (bmi >= 25 and bmi < 30):
st.warning("Overweight")
elif (bmi >= 30):
st.error("Obese")
st.write("Obesity preventive measures")
link = 'https://www.verywellhealth.com/obesity-prevention-4014175'
st.markdown(link, unsafe_allow_html=True)