This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file reading. Then it reads the file one line at a time and cřeates a new friends database to return. Like in the previous function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline. Sample calls should look like this: >> load_friendsdb("friendsdb.tsv")

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter14: Files And Streams
Section: Chapter Questions
Problem 1CP
icon
Related questions
Question
2. load_friendsdb
This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file for
reading. Then it reads the file one line at a time and creates a new friends database to return. Like in the previous
function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline.
Sample calls should look like this:
>>> load_friendsdb("friendsdb.tsv")
[{'name': ' bimmy', 'height': 600}, {'name': Ian Donald Calvin Euclid Zappa', height': 175}]
Transcribed Image Text:2. load_friendsdb This function does the reverse of save_friendsdb -- it takes a single argument, filename, and opens that specified file for reading. Then it reads the file one line at a time and creates a new friends database to return. Like in the previous function, each line will contain a friend's name followed by a tab, then the friend's height, and then a newline. Sample calls should look like this: >>> load_friendsdb("friendsdb.tsv") [{'name': ' bimmy', 'height': 600}, {'name': Ian Donald Calvin Euclid Zappa', height': 175}]
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT