code coach | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

code coach

new to programming having an issue w the "code coach" opens several examples at the same time so your code will only be right for one or the other

30th Nov 2020, 6:53 PM
Myles Magallanes
2 Answers
+ 2
Don't hardcode for one value, the point is to take the input described by the task and to develop an algorithm that works for every possible input. For example, if the task was to sum two numbers, you have to take two numbers as input: n1 = int( input() ) n2 = int( input() ) And then output the sum: print( n1 + n2 ) And not hardcode for one test case, which might be (3, 5): n1 = 3 n2 = 5 print( n1 + n2 ) That would only work for that one specific test case and not constitute a general solution to the problem.
30th Nov 2020, 7:19 PM
Shadow
Shadow - avatar
+ 1
thank you!
30th Nov 2020, 7:22 PM
Myles Magallanes