Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature cli enhancement #334

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

nunster3000
Copy link

Description

Title:

🚀 Added Interactive Command-Line Interface (CLI) for Currency Converter

Description:

This pull request enhances the Currency Converter project by implementing a Command-Line Interface (CLI), allowing users to dynamically input conversion details instead of using hardcoded values. The enhancement significantly improves user experience, flexibility, and usability.

🔹 Key Enhancements:
✅ Interactive CLI Input

Users can enter the amount, source currency, and target currency dynamically.
Eliminates the need for hardcoded values.
✅ Error Handling for Invalid Inputs

Prevents crashes by handling incorrect inputs gracefully.
Displays user-friendly messages for invalid amounts and currency codes.
✅ Integration with Exchange Rate API

Fetches real-time currency exchange rates using https://api.exchangerate-api.com/.
✅ Formatted Output for Better Readability

Displays conversion results in an easy-to-read format.
🔹 Why This Improvement?
Before: The script used hardcoded values, requiring manual edits for different conversions.
Now: The CLI makes the tool dynamic and user-friendly, allowing users to enter inputs interactively.
Error handling ensures the script does not crash due to invalid input.
🔹 Code Changes:
Modified currency-converter.py to:

Implement CLI with input() for user interaction.
Format output for better readability.
Enhance error handling for incorrect inputs.

Checklist:

Please tick all the boxes that are fulfilled by your Pull Request.

  • I have named my files and folder, according to this project's guidelines.
  • My code follows the style guidelines of this project.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have created a helpful and easy to understand README.md, according to the given README_TEMPLATE.
  • My changes do not produce any warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant