Getting Assertion error and also not getting correct output

I have wrote code all correct as you can see in below image.
Please correct me if I was wrong.
{moderator edit: code removed}

after writing code correct I got the following value which is not as expected output.
Please help me to get proper solution.

Also got the assertion error I don’t know why this error came.

  1. Please do not post your code on the forum. That’s not allowed by the community standard.
  2. Check your parenthesis. (1/2*m) is not the same as 1/(2*m).
1 Like

I have edited your post to remove the code.

Hi @Vinayak_Gunjal

The error is because that you want to divide the total cost by 2m but your implementation isn’t correct as you want to do square brackets around the division term like …/(2m) because divide only on …/2 * m it’s lead to divide the total cost only by 2


Sorry sir I wont post that again. Thank you for your help.