0
No output in challenge
I tested this code on swift playgrounds on my iPad in swift 5 and it works fine, but here in swift 4 it has no output, anyone knows why? This code is for the popsicles challenge. https://code.sololearn.com/c2e75GtjFZgj/?ref=app
5 Antworten
+ 1
You have to add the print statement to produce the output:
print(t(x:3,y:9))
+ 1
Coding challenges need to have some output provided, so if you don't call the function, nothing will be produced as a result.
0
thank you, but do you have any idea why it doesn’t work in a coding challenge if I dont put in the line to call the function? so remove line 11
0
sorry I dont mean challenge, its Code Coach, and they run test cases so id think I dont need to call it. but it doesnt work if i dont
0
Korijn Jagersma I meant code coach challenges, too. They evaluate the code by its output, depending on respective input as test cases.
So you have to call the function for your code to give some output (which, in turn, is an input of the test cases).