Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
README.md, according to the givenREADME_TEMPLATE.