Advertisement
noler89

Untitled

Dec 26th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. import requests as req
  2. import json
  3.  
  4. f = open('input.txt','r')
  5. currencies={}
  6. pricelist=[]
  7.  
  8. for line in f:
  9. currencies[line[0:line.find('\t')]]=line[line.find('\t')+1:len(line)-2]
  10.  
  11. f.close()
  12.  
  13. for i in currencies:
  14. responese = req.get('https://min-api.cryptocompare.com/data/price?fsym='+str(i)+'&tsyms=USD')
  15. pricelist.append(responese.json()['USD'])
  16.  
  17. values=[]
  18. sumvalue=0
  19. j=0
  20. for i in currencies:
  21. values.append(float(currencies[i])*float(pricelist[j]))
  22. sumvalue+=values[j]
  23. j+=1
  24. print (sumvalue*57)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement