BMI Calculation - Doubt in Assignment Problem 1 Question 5

I have written a different code for Question 5 in Assignment problem 1 as shown in the image attached and getting right results. But still want to know if there is any flaw in coding or any scope of improvement.

Also I haven’t defined any separate function to convert string into int/float. Is it necessary to define a separate function for it?

1 Like

Hi @aakriti29jain77,
The solution looks fine, but an improvement that you can consider: Try to do the calculations using a functional paradigm, so that it can be reused multiple times.

Please mention the week number in the title, so that it becomes easy for anyone to recognize.

1 Like

Thank you @Ishvinder