Python-Scripts icon indicating copy to clipboard operation
Python-Scripts copied to clipboard

Update currency.py

Open BrahmajitMohapatra opened this issue 1 year ago • 0 comments

Explanation of Key Sections: • Class Definition (Currency_convertor): The class is used to store conversion rates and perform the currency conversion. • API Request (requests.get()): The program uses the requests library to fetch currency data from the fixer.io API. • Conversion Logic (convert function): This function performs the currency conversion using the rates fetched and prints the result in a human-readable format. • Driver Code (if name == "main"): This section handles user input and calls the conversion function to provide output.

Note: • You need to replace 'GET_YOUR_ACCESS_KEY_FROM_fixer.io' with your actual API key from fixer.io.

BrahmajitMohapatra avatar Oct 10 '24 12:10 BrahmajitMohapatra