+ 3
Needs some help
Hey guys I got a question on Input in python when I put something like Phone_number=input() and run it,it's gonna show me something like "Your program needs some input split multiple input something something" I can't really remember right now so what does it mean pls just started a couple days ago and would really appreciate ur help
4 odpowiedzi
+ 2
what input() does is asking the user for an input and then return it. for example:
x = input('What is x? ')
once you run the code, youll be asked for an input (the thing that appears and says ''Your program needs some input...'') . lets say you type a 3 into that field, then:
x = input('What is x? ')
print(x)
# Output:
# 3
as you can see, x is equal to your input. with input you can add interactivity to your code.
(note: input() always returns a string, even if the input contains only numbers, so if you want the input to be an integer, use int(input()), for floats use float(),...)
+ 4
Sage Power ,
the message you are discribing is about the *input procedure* in sololearn playground. since it is not working interactively with the user, we have to do all inputs in advance.
If you have 2 input() function calls in your code, you need to have also 2 input values in the popup window, each in a separate line.
+ 4
Joe ,
there is a typo (a missing opening parenthesis) in the last line of your post:
int(input)) should be: int(input())
0
Add int(input("enter your value here"))