Question: Write a robust python program to create < >. This file consists of the name, age and weight of a kid. Get the number of

Write a robust python program to create <>.

This file consists of the name, age and weight of a kid. Get the number of kids from the user and according to this number, fill the file. While filling the file, for each kid, you need to get the name from the user, generate a random number for the age which must be between 0 and 10, and according to the formula calculate the weight of that kid. To calculate the weight of a kid, please use the following formula:

weight= ( age * (total number of characters of that persons name) ) / 2

#For example, name: Gl, age: 6 weight: (6 * 3) / 2 9,0 kgs

You can see the sample of <> file:

--Sample file format(Please do not write these data on your file, you need to create a file)

Petra 4 10,0

Yaman 5 12,50

Vega 1 2,0

mr 2 4,0

Teoman 3 9,0

Toprak 8 24,0

Elif 6 12,0

Deniz 9 22,50

Then, read this file(<>) line by line and store it into list.

Finally display the kid who has the smallest weight in the array. (According to the sample file, the program must print Vega as an output.)

We can not easily make your program crash. THERE SHOULD BE NO BUGS IN THE CODE YOU WROTE. Your program should be very robust. You should handled all exceptions.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!