How Do You Use Python to Find The Latest Prices of Bitcoin, Ethereum, Litecoin and Ripple?

Problem scenario
You want to use Python to calculate the latest price of various cryptocurrencies. What should you do?

Solution
Prerequisite

This assumes you have installed pip.

Procedures
Install the Python package cryptocompare: pip install cryptocompare

Run this program:

import cryptocompare

print(cryptocompare.get_price('BTC', 'USD'))
print(cryptocompare.get_price('BTC', 'USD'))
print(cryptocompare.get_price('ETH', 'USD'))
print(cryptocompare.get_price('LTC', 'USD'))
print(cryptocompare.get_price('XRP', 'USD'))

If you want to receive free cryptocurrency by just learning more, try Coinbase; it is ideal for Americans. For Europeans, the platform/company Iconomi.com can allow you to buy crypto or learn more.

Leave a comment

Your email address will not be published. Required fields are marked *