Question
PYTHON QUESTION Then write( handwritten ok) a simple python(python 3) program to simulate a simple stock transaction. Ask the user for the starting price per
PYTHON QUESTION
Then write( handwritten ok) a simple python(python 3) program to simulate a simple stock transaction.
Ask the user for the starting price per share of a stock.
starting_price = float(input("What is the starting price per share?: "))
Ask the user how many shares the user wants to buy and read into a variable called numShares.
Then you want to multiply those two variables to get cost. Then take cost multiplied by 1.10(this represents the commission for stock broker) .
Print this total cost out.
print(Total cost is ,totalcost)
Then ask the user to enter the ending price.
Then print out the profit by taking (ending price * number of shares)- total cost.
Print out the profit.
Done.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started