Question: write a function extract stock price () that takes a string representing a stock data record and returns the stock's price as an integer.
write a function extract stock price () that takes a string representing a stock data record and returns the stock's price as an integer. If a price is not found in the string, return O. The price will always be given as an integer. If a float appears in the string you can ignore it and return 0. The stock data record contains the stock symbol, its price, and other data, with each field being separated by a colon.
Step by Step Solution
3.54 Rating (157 Votes )
There are 3 Steps involved in it
Here is a Python function named extractstockprice that does what is described def extractstockprices... View full answer
Get step-by-step solutions from verified subject matter experts
