subject

Use python "files and exceptions"

1- modify the program you wrote for chapter 6 exercise 6 so it handles the following
exceptions:
• it should handle ioerror exceptions that are raised when the file is opened
and data is read from it by printing "trouble opening file. try again." and
not executing any more of the code.
• it should handle any valueerror exceptions that are raised when the items
that are read from the file are converted to a number by printing "file must have
only numbers. try again." and not executing any more of the code.

2- the springfork amateur golf club has a tournament every weekend. the club
president has asked you to write a program that will read each player's name
and score as keyboard input, and then save these as records in a file named
golf. txt.

first, have the program ask the user how many players they want to add to their
record. then, ask the user for each name and score individually.

golf. txt should be structured so that there is a line with the player's name,
folowed by their score on the next line.

emily
30
mike
20
jonathan
23

3- write a program that reads the records from the golf. txt file written in exercise
10a and prints them in the following format:

name: emily
score: 30

name: mike
score: 20

name: jonathan
score: 23

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:00
Which part of the cpu accepts data?
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Determine whether the following careers would require training or college.
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
After you present a proposal, the committee starts asking you questions, some beyond the strict focus of your proposal. they ask questions about implications in other fields and knowledge about other fields. you are asked to redo your proposal. what is most likely missing? breadth of material depth of material clarity of material details of material
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
Sports and entertainment class, your goal is to increase attendance and make a profit for a game by getting your team on a winning track with total salaries less than $3,000,000
Answers: 3
You know the right answer?
Use python "files and exceptions"

1- modify the program you wrote for chapter 6 exercise...
Questions
question
Chemistry, 31.03.2020 00:28
question
Biology, 31.03.2020 00:28
question
History, 31.03.2020 00:28
question
Chemistry, 31.03.2020 00:28
question
Mathematics, 31.03.2020 00:28
question
Mathematics, 31.03.2020 00:29
question
Mathematics, 31.03.2020 00:29
Questions on the website: 13722367