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

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

1 Expert Approved Answer
Step: 1 Unlock

Here is a Python function named extractstockprice that does what is described def extractstockprices... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!