_This pull request enhances the Currency.py and Currencycalculator.py scripts with the following features and improvements:
Caching Mechanism: Introduced a caching system in Currency_calculator.py to store exchange rates locally, minimizing API calls and allowing for offline support.
Enhanced Error Handling: Improved error handling in both scripts to manage invalid inputs, network issues, and unsupported currencies more effectively.
User-Friendly Prompts: Modified the input prompts for better clarity and usability.
Fixed API Integration: Corrected API endpoint usage, ensuring proper interaction with Fixer.io and FloatRates APIs.
Code Comments: Added comments throughout the scripts to explain the changes and new features for better code readability.
Changes Made:
Currency.py:
Added error handling for API requests.
Modified input prompts for better user experience.
Limited the precision of currency conversion to 2 decimal places.
Added inline comments explaining changes and new features.
_Currencycalculator.py:
Introduced a caching system to store exchange rates.
Added user-friendly messages for cache hits and misses.
Enhanced input validation to prevent erroneous conversions.
Included code comments to make the script more understandable.
Tests Conducted:
Tested both scripts with various currency pairs (USD, EUR, INR, GBP) for different amounts.
Verified that caching works as expected in Currency_calculator.py.
Ensured proper error handling by simulating network failures and invalid inputs.
Cross-checked the conversion values with actual exchange rates to ensure accuracy.
Checklist:
**- [ ] I have tested the code locally and ensured it works as expected.
[ ] I have added comments and detailed documentation.
[ ] Code passes all linting and formatting checks.
[ ] Relevant changes are reflected in the README.md.**
Description:
_This pull request enhances the Currency.py and Currencycalculator.py scripts with the following features and improvements:
Changes Made:
Currency.py:
_Currencycalculator.py:
Tests Conducted:
Checklist:
**- [ ] I have tested the code locally and ensured it works as expected.