A flexible temperature conversion tool that converts between Celsius, Fahrenheit, and Kelvin with input validation.
- Converts between Celsius, Fahrenheit, and Kelvin
- Single function handles all conversion combinations
- Input validation for temperature units
- Returns multiple values simultaneously
- Handles edge cases (absolute zero validation)
- Python 3.11
- Dictionaries for formula mapping
This project focuses on:
- Function parameters and return values
- Dictionary-based lookup tables
- Tuple unpacking
- Input validation
- Mathematical formula implementation
python temp_converter.pyEnter temperature value: 100
Enter current unit (C/F/K): C
Enter target unit (C/F/K): F
100.0ยฐC = 212.0ยฐF = 373.15K
- How to use dictionaries to store conversion formulas
- Returning multiple values from a function using tuples
- The importance of input validation for user experience
- Working with floating-point precision in Python
- Celsius to Fahrenheit:
(C ร 9/5) + 32 - Celsius to Kelvin:
C + 273.15 - Fahrenheit to Celsius:
(F - 32) ร 5/9 - Fahrenheit to Kelvin:
(F - 32) ร 5/9 + 273.15 - Kelvin to Celsius:
K - 273.15 - Kelvin to Fahrenheit:
(K - 273.15) ร 9/5 + 32
- Add Rankine and Rรฉaumur scales
- Create a GUI version
- Batch conversion from file input
Built as part of my ML Engineering Roadmap - December 2025