No output in challenge | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

24th May 2020, 11:23 AM
Korijn Jagersma
Korijn Jagersma - avatar
5 Answers
+ 1
You have to add the print statement to produce the output: print(t(x:3,y:9))
24th May 2020, 11:57 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
Coding challenges need to have some output provided, so if you don't call the function, nothing will be produced as a result.
24th May 2020, 12:01 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
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
24th May 2020, 11:59 AM
Korijn Jagersma
Korijn Jagersma - avatar
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
24th May 2020, 12:03 PM
Korijn Jagersma
Korijn Jagersma - avatar
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).
24th May 2020, 12:33 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar