Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ("---------------Welcome to Python Programming Class---------------\nThe purpose of this project is to provide Stock Analysis\nby reading a csv file and preforming analysis on this data")
- import time
- amount = input("Please enter the amount you want to invest ")
- while (amount)is not ():
- amount = float(amount)
- #so every next lab is just adding to the previous lab???
- x = (amount*(1* 0.896163))
- x = float(x)
- y = (amount*(1*0.788753))
- y = float(y)
- z = (amount*(1*69.692853))
- z = float(z)
- print (
- f"\n\nthank you for investing ${format((amount), '.2f')}!!!"
- f"\n\nThe amount you invested in euro is {format((x), '.2f')}euros.",
- f"\nThe amount you invested in pounds is {format((y), '.2f')}pounds.",
- f"\nThe amount you invested in rupees is {format((z), '.2f')} rupees.")
- #are we adding more than just pounds euros and rupees???
- time.sleep (.9)
- #stocks for your fteet
- stocks = ('AAPL, priced at: 150.75\nAXP, priced at: 98.65\nBA, priced at: 340.53\nCAT, priced at: 129.77\nCVX, priced at: 111.77\nDIS, priced at: 111.42\nGS, priced at: 175.37\nHD, priced at: 177.89\nIBM, priced at: 119.83\nINTC, priced at: 47.74')
- sym = [
- 'AAPL',
- 'AXP',
- 'BA',
- "CAT",
- "CVX",
- "DIS",
- "GS",
- "HD",
- "IBM",
- "INTC"
- ]
- price = [
- 150.75,
- 98.65,
- 340.53,
- 129.77,
- 111.77,
- 111.42,
- 175.37,
- 177.89,
- 119.83,
- 47.74
- ]
- #min max function very useful!!!
- print (f"\n________________________________________________\nthere are 10 available stocks\n{stocks}\n\n\n")
- time.sleep (.9)
- p = min(price)
- y = sorted(price)
- if amount <=25:
- print ("you currently do not have enough money to buy any shares of these stocks\n\n\n_________________________________________________")
- again = input("would you like to make another investment??? Y/N: ")
- break
- elif 250 >= amount > 25:
- print (f"The lowest priced stock is: {round(p,1)} dollars.")
- t = ((amount)/(p))
- t = int(t)
- print(f"You can buy {t} shares of the lowest stock")
- #duh always remember proper paran
- elif 1000 >= amount > 250:
- p2 = max(price)
- print (f"The highest priced stock is: {p2}")
- s = ((amount)/(p2))
- s = int(s)
- print (f"You can buy {s} shares of the highest price stock\n\n\n_________________________________________________")
- elif amount > 1000:
- print ("here is a list of stocks with a price range between 50 and 100 dollars")
- for var in y[0:2]:
- print (var)
- time.sleep (2)
- No = ['N', 'no', 'No', 'NO', 'n', 'nope', 'nah']
- Yes = ['Y', 'y', 'yes' 'Yes', 'YES', 'yup', 'yup', 'yee', 'yeah']
- again = input("would you like to make another investment??? Y/N: ")
- if again in Yes:
- amount = input("Please enter the amount you want to invest ")
- elif again not in Yes:
- while again not in No:
- print ("i'm sorry i do not understand that...\n\n\n")
- again = input("would you like to make another investment??? Y/N: ")
- if again in Yes:
- amount = input("Please enter the amount you want to invest ")
- break
- if again in No:
- print ("okay have a nice day!!!")
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement