Skip to content

den01-python-programming/exercise-4-27-records-from-a-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exercise 4.27 Records from a file

In this exercise, we'll be working with files stored in CSV-format that contain names and ages separated by commas. The file format may look like this:

lily,3
anton,5
levi,4
amy,1

Your task is to write a program that first prompts the user for the name of the file they want to read. The program then prints the content of the file in the following way (we're assuming below that the output is from the above-mentioned file):

Name of the file:
**data.txt**
lily, age: 3 years
anton, age: 5 years
levi, age: 4 years
amy, age: 1 year

NB! The word "year" should be formatted based on the age.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages