0

Code challenge Test Inputs

Hello, i'm new to Sololearn (and programming) and i got confused with the input in a Code challenge: i did the paint cost one and used the print command for the first test and it worked but at the second one i just took it into a new one (tried in the same one 2) but it said, the code would be wrong, while my result was the one for the first 2 tests, but it semmed to want them kind of seperated but still in the same output. Can ayone please explain me how is meant to be?

24th May 2025, 12:23 PM
Koljo
Koljo - avatar
7 Answers
+ 6
You are supposed to take input. Do not hard-code the values. If you need help with your code, show your code attempt. Tag the relevant programming language.
24th May 2025, 12:52 PM
Lisa
Lisa - avatar
+ 2
Wenn sololearn deinen Code testet, fĂŒgt es input ein wie ein Benutzer input eingeben wĂŒrde. * Verwende input() und speichere die Eingabe in eine Variable, z.B. inp = input() * Konvertiere den Wert der Variable in einen numerischen Datentyp, z.B. mit float(). * Übergib die Variable als Argument deiner Funktion. * print() das Ergebnis nur einmal. Beachte, dass wir das Ergebnis nicht runden, sondern **auf**runden sollen. Hierzu kannst du die Funktion ceil() aus dem math module importieren: from math import ceil ceil(1.23) # 2 (Beispiel)
24th May 2025, 2:07 PM
Lisa
Lisa - avatar
+ 1
Yes, hidden test cases remain hidden.
25th May 2025, 1:48 PM
Lisa
Lisa - avatar
0
def kosten(p): cost = 1.1*(40+5*p) return round(int(cost)) print(kosten(2),kosten(20)) #Fall 2 #print(kosten(20)) Python Thank you very much
24th May 2025, 1:46 PM
Koljo
Koljo - avatar
0
Tried as alternative print just seperated prints for both inputs
24th May 2025, 1:47 PM
Koljo
Koljo - avatar
0
Ok thank you, i forgot the change of the input Is it normal that the system doesnt show all the test values? It did for mine just show 2 ones but controlled all 5
25th May 2025, 1:46 PM
Koljo
Koljo - avatar
0
Ok thanks 👍
25th May 2025, 1:55 PM
Koljo
Koljo - avatar