+ 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

25th Oct 2018, 11:35 AM
Yash✳️
Yash✳️ - avatar
8 Réponses
+ 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 😂
25th Oct 2018, 11:45 AM
Kishalaya Saha
Kishalaya Saha - avatar
+ 5
Oooh Kishalaya Saha and HonFu thanx! I never would've knows its because of that `input(` in that string 😂
25th Oct 2018, 12:58 PM
Yash✳️
Yash✳️ - avatar
+ 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 😂
25th Oct 2018, 1:29 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 4
S O U ✌️ I K why are you posting that here?
27th Oct 2018, 10:49 AM
Yash✳️
Yash✳️ - avatar
+ 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.
25th Oct 2018, 11:49 AM
HonFu
HonFu - avatar
+ 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? ^^
25th Oct 2018, 11:47 AM
HonFu
HonFu - avatar
+ 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"!
25th Oct 2018, 1:38 PM
HonFu
HonFu - avatar
+ 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
27th Oct 2018, 2:04 PM
S O U ✌️ I K
S O U ✌️ I K - avatar