Created
December 23, 2015 12:17
-
-
Save blueset/1720f24de3fec49bf237 to your computer and use it in GitHub Desktop.
To Bryan 201512230001
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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