Why this doesn't work ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why this doesn't work ?

So I've tried this code in another Website and it works just fine, but here it seems like it doesn't want to work https://sololearn.com/compiler-playground/cUhqeMEM3mbb/?ref=app

11th Dec 2023, 9:46 AM
Rebecca Harris
Rebecca Harris - avatar
4 Answers
+ 8
Rebecca Harris , your code is ok, so you may struggle with the input in sololearn playground. > after pressing the `run` button, a popup window appears. > we have to enter all inputs in advance. > each input has to be in a new line e.g: 3 (press enter) + (press enter) 5 (click submit) > then finally click `submit` from the popup window.
11th Dec 2023, 11:56 AM
Lothar
Lothar - avatar
+ 4
Hi Rebecca, avoid using prompts in the input functionnfor code playground, just use "input()". It won't display in the prompt anyway but will print it to the console at the end, which can cause code coaches to fail as your output doesn't "match".
12th Dec 2023, 3:50 AM
StuartH
StuartH - avatar
+ 2
For some reasons when I choose 3,5 inputs It gives me : "Number? Number? 8" How to make it only 8?
11th Dec 2023, 1:08 PM
Rebecca Harris
Rebecca Harris - avatar
+ 1
To make it only eight you can remove the "Number? " from the inputs. then if you want them to show up and actually say what number you chose i recommend doing it like this: a=int(input()) print("1st number: ",a) b=int(input()) print("2nd number:",b) print("addition: ",a+b)
12th Dec 2023, 1:49 PM
5Just
5Just - avatar