The file contains more than numbers

To see what happened, let's take another look at the judge's score sheet to see if you missed anything:

The judge's official ID badge was covering up the names. "^¡J

Name

Score

Johnny

8.65

Juan

9.12

Joseph

8.45

Stacey

7.81

Aideen

8.05

Zack

7.21

Aaron

8.31

There are two pieces of information on each line: a name and a number (the surfer's score).

The judges also recorded the name of each surf contestant next to his or her score. This is a problem for the program only if the name was added to the results . txt file. Let's take a look:

The vesul-b file-

Johnny

8 .

. 65

Juan

9.

. 12

Joseph

8 .

. 45

Stacey

7 .

81

Aideen

8.

. 05

Zack

7.

21

Aaron a

8.

. 31

k-The (results in the file look like this.

Sure enough, the results . txt file also contains the contestant names. And that's a problem for our code because, as it iterates through the file, the string you read is no longerjurf a number.

Was this article helpful?

0 0

Post a comment