How does Code Coach work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

How does Code Coach work?

I am new to code coach challenge and I just did a challenge (Hovercraft challenge) but it seems my code is not being run or called and the tests cases fail because of no output.. here is my code https://code.sololearn.com/c5cpzm8itNz8/?ref=app

17th Dec 2019, 6:01 AM
Princetronixx
Princetronixx - avatar
6 Answers
+ 17
The code coach compares print output and not returned value So your solution should be printed and not returned Of course you can make a function that returns the solutions and print its return value Few pointers to look out for: Since your solution might print an integer/float value, make sure that you format it properly according to the problem requirements For example, some problems requires a printing of a value with precision of two decimal places, so if you try to print the float 42.40, it will output as 42.4 and the test will fail. So that case will require correct formatting Also look out for printing 0X values such as 05 as int will be printed as 5 and depending on the requirements may also need formatting
17th Dec 2019, 4:34 PM
Burey
Burey - avatar
+ 9
You need to call the function: print(Hovercraft(int(input()))) Also, line 2 should be "variable_costs = unit_sale * 2000000". But your code has 2/5 test cases failed.
17th Dec 2019, 6:06 AM
Diego
Diego - avatar
+ 8
SoloLearn tests your code with 6 different inputs, and checks whether the output is correct.
17th Dec 2019, 6:21 AM
Seb TheS
Seb TheS - avatar
+ 3
the important is, you must find the answer
19th Dec 2019, 5:29 AM
Rrrrrr
Rrrrrr - avatar
0
Thanks for the assist guys. Just finished all the challenges.
21st Dec 2019, 11:07 AM
Princetronixx
Princetronixx - avatar
0
Thanks for the assist guys. Just finished all the challenges. and thanks to you guys I am part of the 100
21st Dec 2019, 11:08 AM
Princetronixx
Princetronixx - avatar