(Solved) (Learned) How to use two different input()? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

(Solved) (Learned) How to use two different input()?

Hi dear coders, I’m trying to use two input in a same project. I need 2 different integer (speed and passenger) for seatbelt warning. If i write a number to “y” variable its working but i wanna to take this information from user. x=input() y=input() speed=int(x)>20 passengers=int(y)>0 if speed and passengers: print("Fasten your seatbelt!") Traceback (most recent call last): File "./Playground/file0.py", line 3, in <module> y=input() EOFError: EOF when reading a line

28th Dec 2023, 10:15 AM
Numan Batur
Numan Batur - avatar
3 Answers
+ 6
Look at the small font text in the pop-up window. You need to submit all inputs at the beginning of the program. Separate multiple inputs by a line break.
28th Dec 2023, 10:57 AM
Lisa
Lisa - avatar
+ 3
Ahh. I couldn’t understand well this text. You are the hero! Thank you so much.
28th Dec 2023, 11:01 AM
Numan Batur
Numan Batur - avatar