Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help Take-Home Exam 4 Due January 15th,2023, Sunday, 23:59 (Sharp Deadline) Introduction The aim of this homework is to practice on file operations and

please help
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Take-Home Exam 4 Due January 15th,2023, Sunday, 23:59 (Sharp Deadline) Introduction The aim of this homework is to practice on file operations and dictionaries. In addition, please try to utilize functions since they would reduce the complexity of your program. Description You are given a file named "turkiye_spotify_data, txt', which stores the dally ranking of top 200 songs listened in Turkiye by Spotify users between 1 st January 2017 to 9th January 2018 (including both). Your task is to develop a Python program which, given a year and a month, recommends that month's top hits in sequence until the song the user wants to hear is found. In your program, the user will provide two inputs: year and month. Herein, the year must be either 2017 or 2018 , and the month must be between 1 and 12 , if the year is 2017: and only 1, if the year is 2018. Your program should moke sure that the inputs provided obey the rules mentioned. Your code will then process the given Spotify data to find the song with the most streams in the specified year and month. As your program suggests songs to its usec, it will also ask whether they want to Iisten to this song or not. When the answer is yes, your program should share the Some tools might become unavailable due to heavy collaborator use of this document. Learn more Input File You will be given only one input file sample. The name of this input file will be turkiye_spotify_data. txt. This file contains information about the songs on Spotify, including the song's position on the chart, the track name, artist, number of streams, URL, release date, and region. Each line of this file represents a different song, and the data for each song is separated by a horizontal tab character (") (t). You can assume that the file information will be given in the correct format. Thus, you don't have to perform any format check on the file content. You can also assume that there are no duplications and no empty lines in the file. However, you cannot make any assumptions on the number of lines of this file. Keep this in mind while you're preprocessing the content of the file. THE FOLLOWING RED PART WAS ARDED LATER, PLEASE CHECK IT OUT Note that there can be different versions of some songs with the same name (but with a different url). For instance "cheap Thrilis" from "ista" has two different versions in January 2017 with the following links: Please consider them os the same song, and consider their both streaming counto, but the link for this song should be the first link that appears on this month. So; the track name + artlat neme together should be unique. And the link for cheap Thirliils, =1x in january 2017 should be the following one: ome tools might become unavailable due to heavy collaborator use of this document. Learn more Spotiry data to tind the song with the most streams in the speciried year and month. As your program suggests songs to its user, it will also ask whether they want to listen to this song or not. When the answer is yes, your program should share the url of the song and finish afterwards. Otherwise, your program should continue suggesting upcoming songs based on the streaming number in the asked month, until the user decides to listen. Please see the "Sample Runs" section for better understanding on the flow of the program, the inputs and the outputs. THE FOILOWING RED PART WAS ADDED LATER, PLEASE CHECK IT OUT Note that there can be different versions of some songs with the same name (but with a different url). For instance "Cheap Thrit1ls" from "sia" has two different versions in January 2017 with the following links: 'https://open, spocify-coth/track/27sdWb2rFzo6GWiYppro9y, 'hetps: /lopen. spot ify. com/track/378iszndTzAfiddskystic 6 ' Please consider them as the same song, and consider their both streaming counts, but the link for this song should be the first link that appears on this month. So, the track name + artist name together should be unique. And the link for cheap Tirit115, 81a in January 2017 should be the following one: Input and Output The inputs of the program and their order are explained below. It is extremely important to follow this order since we automatically process your programs. Thus your work will be graded as 0 unless the order is entirely correct. Please see the "Sample Runs" section for some examples. The promptsiof the input stotements to be used hai to be exnctly the same as the prompts of the "Sample Runs". Let Ne Love You DU snake 25425 httpy://open.jpotify.com/txack/4pdetReAmogQD1J3Fkg45m lont on You Le 20231 httpsi/lopen-ppotify, ocon/track/3sqviaarbic1yzbDKJS20C 20170101 Cheap thrilin Sta 17716 https:/lopen,epotify.com/track/27skwb2rfxo6Gwiyperv9 20170102. Take-Home Exam 4 Due January 15th,2023, Sunday, 23:59 (Sharp Deadline) Introduction The aim of this homework is to practice on file operations and dictionaries. In addition, please try to utilize functions since they would reduce the complexity of your program. Description You are given a file named "turkiye_spotify_data, txt', which stores the dally ranking of top 200 songs listened in Turkiye by Spotify users between 1 st January 2017 to 9th January 2018 (including both). Your task is to develop a Python program which, given a year and a month, recommends that month's top hits in sequence until the song the user wants to hear is found. In your program, the user will provide two inputs: year and month. Herein, the year must be either 2017 or 2018 , and the month must be between 1 and 12 , if the year is 2017: and only 1, if the year is 2018. Your program should moke sure that the inputs provided obey the rules mentioned. Your code will then process the given Spotify data to find the song with the most streams in the specified year and month. As your program suggests songs to its usec, it will also ask whether they want to Iisten to this song or not. When the answer is yes, your program should share the Some tools might become unavailable due to heavy collaborator use of this document. Learn more Input File You will be given only one input file sample. The name of this input file will be turkiye_spotify_data. txt. This file contains information about the songs on Spotify, including the song's position on the chart, the track name, artist, number of streams, URL, release date, and region. Each line of this file represents a different song, and the data for each song is separated by a horizontal tab character (") (t). You can assume that the file information will be given in the correct format. Thus, you don't have to perform any format check on the file content. You can also assume that there are no duplications and no empty lines in the file. However, you cannot make any assumptions on the number of lines of this file. Keep this in mind while you're preprocessing the content of the file. THE FOLLOWING RED PART WAS ARDED LATER, PLEASE CHECK IT OUT Note that there can be different versions of some songs with the same name (but with a different url). For instance "cheap Thrilis" from "ista" has two different versions in January 2017 with the following links: Please consider them os the same song, and consider their both streaming counto, but the link for this song should be the first link that appears on this month. So; the track name + artlat neme together should be unique. And the link for cheap Thirliils, =1x in january 2017 should be the following one: ome tools might become unavailable due to heavy collaborator use of this document. Learn more Spotiry data to tind the song with the most streams in the speciried year and month. As your program suggests songs to its user, it will also ask whether they want to listen to this song or not. When the answer is yes, your program should share the url of the song and finish afterwards. Otherwise, your program should continue suggesting upcoming songs based on the streaming number in the asked month, until the user decides to listen. Please see the "Sample Runs" section for better understanding on the flow of the program, the inputs and the outputs. THE FOILOWING RED PART WAS ADDED LATER, PLEASE CHECK IT OUT Note that there can be different versions of some songs with the same name (but with a different url). For instance "Cheap Thrit1ls" from "sia" has two different versions in January 2017 with the following links: 'https://open, spocify-coth/track/27sdWb2rFzo6GWiYppro9y, 'hetps: /lopen. spot ify. com/track/378iszndTzAfiddskystic 6 ' Please consider them as the same song, and consider their both streaming counts, but the link for this song should be the first link that appears on this month. So, the track name + artist name together should be unique. And the link for cheap Tirit115, 81a in January 2017 should be the following one: Input and Output The inputs of the program and their order are explained below. It is extremely important to follow this order since we automatically process your programs. Thus your work will be graded as 0 unless the order is entirely correct. Please see the "Sample Runs" section for some examples. The promptsiof the input stotements to be used hai to be exnctly the same as the prompts of the "Sample Runs". Let Ne Love You DU snake 25425 httpy://open.jpotify.com/txack/4pdetReAmogQD1J3Fkg45m lont on You Le 20231 httpsi/lopen-ppotify, ocon/track/3sqviaarbic1yzbDKJS20C 20170101 Cheap thrilin Sta 17716 https:/lopen,epotify.com/track/27skwb2rfxo6Gwiyperv9 20170102

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

9. How are they similar to you? (specifically)

Answered: 1 week ago

Question

13. What are their tastes? (refined, middle class, or subsistence)

Answered: 1 week ago