Menu

Use Python 373 Write Function Ticker First Runs Reads Txt File Stores Returned Dictionary Q43800969

Use python 3.7.3

Write a function ticker() that first runs readsa txt file, and then stores the returned dictionary. It then runsan interactive loop with the user in which the user is prompted fora company name. If the company name (key) is in the dictionary,then its ticker form and the IPO year is printed. Otherwise awarning is printed that the company name is not in the list. If theuser just hits return without entering a name, the loop stops.

>>> ticker()

Company name: Amazon.com

No ticker symbol on record for Amazon.com

Company name: Americao

No ticker symbol on record for Americao

Company name: Morningstar, Inc.

Morningstar, Inc. has ticker MORN. IPO: 2005

Company name:

>>>

nasdaq.txt :
TFSC   1347 Capital Corp.   2014
TFSCR   1347 Capital Corp.   2014
TFSCU   1347 Capital Corp.   2014
TFSCW   1347 Capital Corp.   2014
PIH   “1347 Property Insurance Holdings,Inc.”   2014
FLWS   “1-800 FLOWERS.COM, Inc.”   1999
FCTY   “1st Century Bancshares, Inc”  n/a
FCCY   1st Constitution Bancorp (NJ)  n/a
SRCE   1st Source Corporation   n/a
VNET   “21Vianet Group, Inc.”   2011
TWOU   “2U, Inc.”   2014
DGLD   3X Inverse Gold ETN Velocityshares  n/a
DSLV   3X Inverse Silver ETN Velocityshares  n/a
UGLD   3X Long Gold ETN Velocityshares  n/a
USLV   3X Long Silver ETN Velocityshares  n/a
JOBS   “51job, Inc.”   2004
SIXD   “6D Global Technologies, Inc.”  n/a
CAFD   8point3 Energy Partners LP   2015
EGHT   8×8 Inc   n/a
AVHI   “A V Homes, Inc.”   n/a
SHLM   “A. Schulman, Inc.”   1972
AAON   “AAON, Inc.”   n/a
ABAX   “ABAXIS, Inc.”   1992
ABY   Abengoa Yield plc   2014
ABGB   “Abengoa, S.A.”   2013
ABEO   Abeona Therapeutics Inc.   n/a
ABEOW   Abeona Therapeutics Inc.   n/a
ABMD   “ABIOMED, Inc.”   n/a
AXAS   Abraxas Petroleum Corporation  n/a
ACTG   Acacia Research Corporation   n/a
ACHC   “Acadia Healthcare Company, Inc.”  n/a
ACAD   ACADIA Pharmaceuticals Inc.   1985

Expert Answer


Answer to Use python 3.7.3 Write a function ticker() that first runs reads a txt file, and then stores the returned dictionary. It…

OR