SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 305 Weeks Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 06 Nov 2017 My Price 10.00

Check if a song with that rank exists in the dictionary

Needs to be written in python code with a .py attachment. Please refer to attachment

  • Attached to this homework is a text file that has 355 lines. Each line contains some song information. This information is rank of song, artist, and title of song.

    The rank is a number between 1 and 500.

    Write a program that reads the file line by line. Then parses each line to two parts. First part is the ranking. Second part is the artist and title of song. Then your program should utilize dictionaries to save this information. The song rank should be the unique id (key). The artist and title should be mapped to the rank(Value). An item in the dictionary will look like this

    “400 : Bruce Springsteen, Pink Cadillac”

    Your program should:

    1.  Ask the user to input a rank between 1 and 500.

    2. Check if a song with that rank exists in the dictionary

    If yes:

    Print the name of the artist along with the song title

    If no:

    Print a message indicating that there is no song with the requested rank.

    Output examples:

    If the user input the rank 480, the following output is produced:

    Text Box: Welcome to the “Song Ranker “
Enter a song rank to check the song availability: 480 (user input)
480Peter Gabriel, Sledgehammer
 

     

     

     

     

     

     

     


    If the user input the rank 120, the following output is produced:

    Text Box: Welcome to the “Song Ranker “   
Enter a song rank to check the song availability: 120 (user input)
Sorry. There is no song with this ranking in my archive.
 

     

     

     

     

     

     

     

Attachments:

Answers

(5)
Status NEW Posted 06 Nov 2017 01:11 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)