Fahrenheit to celsius (Checker not working?)

Back to General discussions forum

daniel_l     2015-06-26 23:40:07

I'm pretty sure the checker is not working on this problem, but I may have missed something. Any help would be appreciated

num_str = input('> ') 
the_array = num_str.split(" ") 
ar = []
for val in the_array:
   ar.append(float(val))

for n in ar:/n
   celsius = (n - 32) / 1.8
   print(round(celsius))
TestUser     2015-06-27 06:46:46
User avatar

Hi! Thanks for your message!

> I'm pretty sure the checker is not working on this problem

It will help a lot if you tell "how exactly" does it "not working" :)

For me this sounds like the site crashes and you see no result page at all. If you get some results, but they are wrong, it is useful to post your result and expected result so that we can compare.

By the way it looks you missed that "Input data contains N+1 values, first of them is N itself (Note that you should not try to convert it). So probably skipping the first element may help. (I agree that input format for this problem is somewhat bewildering, sorry)

Also I'm not sure your "print" function outputs the result into a single line with spaces - but I do not know whether this will affect the checker.

daniel_l     2015-06-28 23:01:47

Hi, Thanks for your response. Yeah, I didn't give a whole lot to go on for my question. Anyway, The values I input for fahrenheit are:

31 288 597 195 205 344 93 322 580 275 301 165 565 512 204 368 536 480 340 583 495 411 337 283 58 514 554 485 36 141 554 93

and the output that I get for celsius is

-1 142 314 91 96 173 34 161 304 135 149 74 296 267 96 187 280 249 171 306 257 211 169 139 14 268 290 252 2 61 90 4

I'm getting the right output for celsius rounded to the nearest whole number. I guess I'm just confused on where I may have went wrong.

drewcocker     2015-06-29 04:18:50
User avatar

Looks like two issues - as TestUser mentioned, don't convert the first value because it is the count of test cases and your last two values are incorrect.

Please login and solve 5 problems to be able to post at forum