Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests as req
- import json
- f = open('input.txt','r')
- currencies={}
- pricelist=[]
- for line in f:
- currencies[line[0:line.find('\t')]]=line[line.find('\t')+1:len(line)-2]
- f.close()
- for i in currencies:
- responese = req.get('https://min-api.cryptocompare.com/data/price?fsym='+str(i)+'&tsyms=BTC')
- pricelist.append(responese.json()['BTC'])
- values=[]
- sumvalue=0
- j=0
- for i in currencies:
- values.append(float(currencies[i])*float(pricelist[j]))
- sumvalue+=values[j]
- j+=1
- print(values)
- print (sumvalue)
- print (sumvalue*981000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement