Skip to content
Advertisement

HackerRank Plus Minus ~ no response on stdout ~

Can someone please explain why hackerrank does not accept this code for python?

JavaScript

It gives me this error: ~ no response on stdout ~

Advertisement

Answer

You will notice that on HackerRank your function is called without doing anything with the return value. The template code looks like this:

JavaScript

Moreover, the description says:

Print the decimal value of each fraction on a new line.

So you should print the result. And since your code doesn’t print anything, the error message is what could be expected.

Instead of return, do:

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement