A simple and beginner-friendly Python CLI tool that converts temperatures between Celsius and Fahrenheit, using the argparse module for clean command-line options.
- Convert from Celsius to Fahrenheit (
--c2f) - Convert from Fahrenheit to Celsius (
--f2c) - Helpful messages and argument validation using
argparse
This script accepts one of two command-line arguments:
--c2f <value>: Converts Celsius to Fahrenheit--f2c <value>: Converts Fahrenheit to Celsius
- Python 3.x
No additional libraries are needed.
$ python converter.py --c2f 100
100.0°C is 212.00°F