+ 8
[ANSWERED]Quick Question
Why does it ask for the input? Is it because I've written "inputNum" in my code? But it should not be like that :/ It gets annoying after sometime 😅 i even saved it as a different code but it still ask for input. https://code.sololearn.com/c2ssiVNWR8Gh/?ref=app https://code.sololearn.com/cjbr0blU1489/?ref=app
8 ответов
+ 5
Not exactly. It's because you have "input(" in your codes in line 10. Remove the opening parenthesis, and it won't prompt you.
I've experimented with this quite a bit 😂
+ 5
Oooh Kishalaya Saha and HonFu thanx! I never would've knows its because of that `input(` in that string 😂
+ 4
HonFu sorry I'd missed your question. My guess is, there must not be any alphabet, number or underscore before "input(", unless it's part of an inline comment. Spaces between "input" and "(" is also fine, of course. But something like
exec("in" + "put()")
wouldn't trigger it, even though it actually does require an input. [This example is thanks to Flandre Scarlet]
Sololearn probably does some quick string search to see if the code needs an input.
That's for the app. For the browser, if I remember correctly, they don't even look for the opening parenthesis 😂
+ 4
S O U ✌️ I K why are you posting that here?
+ 3
Nice, Kishalaya, I didn't know that yet.
Is it only for strings, though?
I tried to use a name xinput and defined a function xinput() and both worked without getting the cram window.
+ 2
Hehe, yeah, if you put input in your code, sololearn will ask for input, even if it's in a string.
If you use a regular # comment you should be okay.
Wait - you got input in your names, hm? ^^
+ 2
You could only miss it - it wasn't there earlier. ;)
Nice find by Flandre!
Funny - we get that dreaded error, BUT WE WEREN'T EVEN ASKED!!12"!
+ 1
Yash Kandalkar sorry actually I had this link in my clipboard and at the same time this discussion was open on my screen probably when I was trying to comment on this discussion it by mistake got posted. I removed it. sorry for any inconvenience