subject

The tab cereal. scsv contains the nutritional information for over 70 cereals. However it's in a format that is rarely used (semi-colon separated values). The reason it's in this format is that a few cereals have commas in their name (e. g. Fruit & Fibre Dates, Walnuts, and Oats). For this lesson you will convert this format to the more common csv file format (comma separated values). There are two standard ways to treat values with commas in them when writing out a csv file: Put the entire value in quotes (e. g. "Fruit & Fibre Dates, Walnuts, and Oats") Use a different separator (e. g. Fruit & Fibre Dates; Walnuts; and Oats) We will chose the latter and use semicolons for those values that have commas in them. Write a function named convert_table. It has two parameters a filename to be read (the scsv file) and a filename to be written (the csv file). Name them filename_in and filename_out. Open, read, and parse the scsv file (i. e. filename_in) Write out the same contents to filename_out but separate the values (columns) with commas. For those values that have commas in them, replace the commas with semicolons. Be sure to end each line (except the last line) with a newline. Return True from the function. Normally you would return a boolean indicating success or failure do NOT use any helper libraries (e. g. pandas, csv, etc).

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:50, bessieyounger1211
Click on this link toopens a new window. bring up a flowchart in a new browser window. based on this flowchart, would a d-link 3347 gateway with an xbox 360 multiplayer problem be in scope or out of scope
Answers: 2
image
Computers and Technology, 22.06.2019 12:00, Cocco
Which of the following does 3d animation create an illusion of on the screen? a. depth b. emotion c. length d. dialogue
Answers: 1
image
Computers and Technology, 24.06.2019 08:20, brinks7994
Which type of entity describes a fundamental business aspect of a database? a. linking b. lookup c. domain d. weak
Answers: 3
image
Computers and Technology, 24.06.2019 13:30, iicekingmann
In the rgb model, which color is formed by combining the constituent colors? a) black b) brown c) yellow d) white e) blue
Answers: 1
You know the right answer?
The tab cereal. scsv contains the nutritional information for over 70 cereals. However it's in a for...

Questions in other subjects:

Konu
Biology, 25.03.2021 16:30
Konu
Physics, 25.03.2021 16:30
Konu
Mathematics, 25.03.2021 16:30