Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import requests
ui_bitcoin = ["bitcoin", "bitcoin price"]
ui_gold = ["gold", "gold price"]
bye = ["bye", "goodbye", ""]
def ui(enter):
for word in ui_bitcoin:
if enter.lower().strip() == word.lower().strip():
bit = requests.get('https://api.coindesk.com/v1/bpi/currentprice.json')
print ('₤' + bit.json()['bpi']['GBP']['rate'] + " For 1 BTC")
return bit
for worn in ui_gold:
if enter.lower().strip() == word.lower().strip():
gold = requests.get('http://gold-feed.com/paid/d7d6s6d66k4j4658e6d6cds638940e/all_metals_json_usd.php')
print ('₤' + (gold.json()['gold_londonfix_pm']) + " Per 10 grams of 14K gold")
for word in bye:
if enter.lower().strip() == word.lower().strip():
gbye = ("Thank you for using our service!")
print(gbye)
exit()
return gbye
while True:
ui(input("Please enter Bitcoin or Gold: "))