Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. 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")
  2. import time
  3. amount = input("Please enter the amount you want to invest ")
  4. while (amount)is not ():
  5. amount = float(amount)
  6. #so every next lab is just adding to the previous lab???
  7. x = (amount*(1* 0.896163))
  8. x = float(x)
  9. y = (amount*(1*0.788753))
  10. y = float(y)
  11. z = (amount*(1*69.692853))
  12. z = float(z)
  13. print (
  14. f"\n\nthank you for investing ${format((amount), '.2f')}!!!"
  15. f"\n\nThe amount you invested in euro is {format((x), '.2f')}euros.",
  16. f"\nThe amount you invested in pounds is {format((y), '.2f')}pounds.",
  17. f"\nThe amount you invested in rupees is {format((z), '.2f')} rupees.")
  18. #are we adding more than just pounds euros and rupees???
  19. time.sleep (.9)
  20. #stocks for your fteet
  21. 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')
  22. sym = [
  23. 'AAPL',
  24. 'AXP',
  25. 'BA',
  26. "CAT",
  27. "CVX",
  28. "DIS",
  29. "GS",
  30. "HD",
  31. "IBM",
  32. "INTC"
  33. ]
  34. price = [
  35. 150.75,
  36. 98.65,
  37. 340.53,
  38. 129.77,
  39. 111.77,
  40. 111.42,
  41. 175.37,
  42. 177.89,
  43. 119.83,
  44. 47.74
  45. ]
  46. #min max function very useful!!!
  47. print (f"\n________________________________________________\nthere are 10 available stocks\n{stocks}\n\n\n")
  48. time.sleep (.9)
  49. p = min(price)
  50. y = sorted(price)
  51. if amount <=25:
  52. print ("you currently do not have enough money to buy any shares of these stocks\n\n\n_________________________________________________")
  53. again = input("would you like to make another investment??? Y/N: ")
  54. break
  55. elif 250 >= amount > 25:
  56. print (f"The lowest priced stock is: {round(p,1)} dollars.")
  57. t = ((amount)/(p))
  58. t = int(t)
  59. print(f"You can buy {t} shares of the lowest stock")
  60. #duh always remember proper paran
  61. elif 1000 >= amount > 250:
  62. p2 = max(price)
  63. print (f"The highest priced stock is: {p2}")
  64. s = ((amount)/(p2))
  65. s = int(s)
  66. print (f"You can buy {s} shares of the highest price stock\n\n\n_________________________________________________")
  67. elif amount > 1000:
  68. print ("here is a list of stocks with a price range between 50 and 100 dollars")
  69. for var in y[0:2]:
  70. print (var)
  71. time.sleep (2)
  72. No = ['N', 'no', 'No', 'NO', 'n', 'nope', 'nah']
  73. Yes = ['Y', 'y', 'yes' 'Yes', 'YES', 'yup', 'yup', 'yee', 'yeah']
  74. again = input("would you like to make another investment??? Y/N: ")
  75. if again in Yes:
  76. amount = input("Please enter the amount you want to invest ")
  77. elif again not in Yes:
  78. while again not in No:
  79. print ("i'm sorry i do not understand that...\n\n\n")
  80. again = input("would you like to make another investment??? Y/N: ")
  81. if again in Yes:
  82. amount = input("Please enter the amount you want to invest ")
  83. break
  84. if again in No:
  85. print ("okay have a nice day!!!")
  86. break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement