Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PYTHON: 6.21 Write function ticker) that takes a string (the name of a file) as

ID: 3675078 • Letter: P

Question

PYTHON:

6.21 Write function ticker) that takes a string (the name of a file) as input. The file will contain company names and stock (ticker) symbols. In this file, a company name will occupy a line, and its stock symbol will be in the next line. Following this line will be a line with another company name, and so on. Your program will read the file and store the name and stock symbol in a dictionary. Then it will provide an interface to the user so that the user can obtain the stock symbol for a given company. Test your code on the NASDAQ 100 list of stock given in file nasdaq.txt. >>> ticker ( nasdaq.txt') Enter Company name: YAHOO

Explanation / Answer

If you want to achive the same by giving the company's name as an input, please use the below piece of code: