Skip to content

Instantly share code, notes, and snippets.

@blueset
Created December 23, 2015 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blueset/1720f24de3fec49bf237 to your computer and use it in GitHub Desktop.
Save blueset/1720f24de3fec49bf237 to your computer and use it in GitHub Desktop.
To Bryan 201512230001
orders = []
for i in range(10):
purpose = raw_input("Would you like to buy or sell?")
if purpose not in ['buy', 'sell']:
print("You don't anyhow ah.")
exit()
try:
price = float(raw_input("At what price would you like to buy/sell?"))
quantity = float(raw_input("What is the quantity you would like to buy/sell?"))
except ValueError:
print("You don't anyhow ah.")
exit()
orders.append({'purpose': purpose, 'price': price, 'quantity': quantity})
for id, order in enumerate(orders):
print("Order No.", id)
print("Purpose: ", order['purpose'])
print("Price: ", order['purpose'])
print("Quantity: ", order['quantity'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment