A lightweight Python utility that effortlessly converts weight between kilograms (kg) and pounds (lbs).
- 🔄 Seamless conversion between kg and lbs
- 🔧 Simple and intuitive user interface
- 🚀 Instant calculation with accurate results
- Python 3.x
# Clone the repository
git clone https://github.com/Naeem-360/weight-converter.git
# Navigate to the project directory
cd weight-converterRun the script using Python:
python weight_converter.pyWeight: 70
(K)g or (L)bs: K
Weight in Lbs: 154.0
Weight: 154
(K)g or (L)bs: L
Weight in Kg: 69.3
The script uses the following conversion formula:
- 1 kg = 2.2 lbs
weight = int(input("Weight: "))
unit = input("(K)g or (L)bs: ")
if unit.upper() == "L":
converted = weight / 2.2
print("Weight in Kg: ", converted)
else:
converted = weight * 2.2
print("Weight in Lbs: ", converted)- The script accepts weight as an integer input
- Unit selection is case-insensitive (both 'k' and 'K' work for kilograms)
- Results are displayed with floating-point precision
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is MIT licensed.