+ 1
Why can't we put multiple inputs in python
x=0 while x<=4: x=int(input("enter number")) print(x) x=x+1 it only prints value 1 time
8 Answers
+ 1
x=0
while x<=4:
num=int(input())
print(num)
x=x+1
now the input variable isn't the same as in the condition of the while loop
+ 1
You can, but you did it wrong.
Your input overwrites x. You need to give it another name. Or input numbers <=4 and as last input something > 4
+ 1
so we have to enter all the five inputs at a time?
+ 1
thanks buddy...for the help...thats the error i was doing...i was entering just one input at a timeđđđ
0
@Alex can u explain me how will u write the code without overwriting it?
0
i am getting an EOF error on line 3
0
https://code.sololearn.com/cqitewD5znRs/?ref=app
the inputs need to be in separate lines. I'm not good in Python, since I rarely use it. There surely is a way to separate the inputs with a space. Maybe someone who knows python better can give you a better code ^^
0
yes. you need to input all values before the code runs here in sololearn