Coding Projects
June 16, 2025 at 07:15 PM
🚀 *Mini Coding Project: Build a BMI Calculator Using Python* 🐍
Perfect for beginners! This project will help you understand basic Python syntax, user input, and simple logic.
🔹 *📌 Project Goal:*
Ask the user for their height and weight, calculate BMI, and give health feedback based on the result.
🔹 *📋 Steps to Build:*
1️⃣ *Take Input from User*
- Height (in meters)
- Weight (in kilograms)
2️⃣ *Apply BMI Formula:*
*BMI = weight / (height * height)*
3️⃣ *Use Conditions to Categorize:*
- Underweight (BMI < 18.5)
- Normal (18.5 <= BMI < 25)
- Overweight (25 <= BMI < 30)
- Obese (BMI >= 30)
🔹 *💻 Python Code:*
```python
print("Welcome to the BMI Calculator!")
height = float(input("Enter your height in meters: "))
weight = float(input("Enter your weight in kg: "))
bmi = weight / (height ** 2)
print(f"Your BMI is: {bmi:.2f}")
if bmi < 18.5:
print("You are underweight.")
elif bmi < 25:
print("You have a normal weight.")
elif bmi < 30:
print("You are overweight.")
else:
print("You are obese.")
```
🔹 *✅ What You’ll Learn:*
• Taking user input
• Using variables and math operators
• Writing if-else conditions
• Printing formatted output
💬 *React ❤️ for more!*
❤️
👍
❤
😮
43