pythonbiopythonrosalind

Rosalind doesn't accept "Variables and Some Arithmetic" task


Link for the problem http://rosalind.info/problems/ini2/

Given: Two positive integers a and b, each less than 1000.
Return: The integer corresponding to the square of the hypotenuse of the right triangle whose legs have lengths a and b

For example, for a, b = 3,4 return 25

The dataset is always different for every trial.

a=859
b=938
print( a**2 + b**2 )

I've tried this code on my computer, and it worked. But Rosalind won't take it. What might be wrong in this code?


Solution

  • It's working fine for me. You probably

    1) Did not put in the correct input variables after you failed the first few tries.

    2) Used the answer box to post your code.

    If you see the Notes section in http://rosalind.info/problems/ini2/ You'll notice that it is mentioned that the Dataset changes everytime you click on Download Dataset.

    Also, keep in mind the default box provided is only there for you to input the answer, and not the code itself. If you want to upload your code as well, you'll need to Upload that using the appropriate code upload tool as specified in the second Point of the Notes section.