An open API service indexing awesome lists of open source software.

https://github.com/corado-bogos/weight_conversion_program

A simple Python console program that converts weight between kilograms and pounds. The user inputs a value, selects the unit, and gets the converted result. Demonstrates if/elif, user input handling, and type conversion. Personal and educational use only — see LICENSE.md.
https://github.com/corado-bogos/weight_conversion_program

beginner cli console converter learning python weight

Last synced: about 1 month ago
JSON representation

A simple Python console program that converts weight between kilograms and pounds. The user inputs a value, selects the unit, and gets the converted result. Demonstrates if/elif, user input handling, and type conversion. Personal and educational use only — see LICENSE.md.

Awesome Lists containing this project

README

          

# Weight Conversion Program

A beginner-friendly Python console program that converts weight between **kilograms (kg)** and **pounds (lbs)**.

![Python](https://img.shields.io/badge/python-3-blue)
![License](https://img.shields.io/badge/license-Personal%20%26%20Educational-green)

---

## What it does

- Asks for a weight value and the unit (`k` for kg, `p` for lbs)
- Converts to the other unit using `1 kg = 2.205 lbs`
- Prints the result rounded to 2 decimals
- Handles an invalid unit choice gracefully

---

## Run it

Requires **Python 3** (no external packages).

```bash
python3 weight_conversion_program.py
```

---

## Example

```
Enter your weight: 70
Kilograms or Pounds (k/p): k
Your weight is: 154.35 Lbs.
```

---

## What I practiced

- Reading and converting user input (`float`, `input`)
- Conditional logic (`if` / `elif` / `else`)
- Basic arithmetic and `round()`
- Structuring a small Python script

---

## License

Personal and educational use only. See [LICENSE.md](LICENSE.md).