Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use python 2.7 Your task for this part is to read the values off of a file and generate a nested list structure. Each element

image text in transcribedimage text in transcribed

use python 2.7

Your task for this part is to read the values off of a file and generate a nested list structure. Each element of the list being returned is itself a list. The second level list consists of a name and a list of ratings. parse_ratings(..) This function takes a parameter, file_name, and returns a list of the parsed lines from the file. Your function should read each line of the file, extract the data, and store the usernames and book ratings in the nested list structure you are returning. The file that you have to read the data from holds usernames and book ratings; it has the following format: David, 123 0 5 Camilla, 5 3 2 0 0 Monika, 0 0 3 Notes: 1) User names and book ratings are separated by '' 2) Book ratings are separated by a space. 3) The number of ratings can vary from user to user 4) A rating spans the values 0-5

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

Explain consumer behaviour.

Answered: 1 week ago

Question

Explain the factors influencing consumer behaviour.

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago