Skip to content

Instantly share code, notes, and snippets.



Created Dec 23, 2015
What would you like to do?
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.")
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.")
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