Merge pull request #22 from zmanian/UserInputReadability

Nits to improve readbility of the user input code
This commit is contained in:
arcalinea 2017-08-27 13:50:20 -07:00 committed by GitHub
commit 628352de33
1 changed files with 5 additions and 3 deletions

View File

@ -10,12 +10,14 @@ def enter_trade_id():
def get_trade_amounts():
amounts = {}
sell_currency = input("Which currency would you like to trade out of (bitcoin or zcash)? ")
if sell_currency == '':
if sell_currency == '' or sell_currency == 'bitcoin' :
sell_currency = 'bitcoin'
if sell_currency == 'bitcoin':
buy_currency = 'zcash'
else:
elif sell_currency == 'zcash':
sell_currency = 'zcash'
buy_currency = 'bitcoin'
else:
raise ValueError('Mistyped or unspported cryptocurrency pair')
print(sell_currency)
sell_amt = input("How much {0} do you want to sell? ".format(sell_currency))
if sell_amt == '':