+ 1
How to take two inputs from a user in the code playground?
I have to take two numbers from the user as two inputs, but it's showing 'Syntax error: error unexpected EOF while parsing' What I am trying is a = int(input('enter no.\n')) b = int(input('enter no. \n'))
4 Respuestas
+ 5
use split method like
a, b = [int(i) for i in input().split()]
or separate your inputs using enter like this:
15
16
+ 2
Your version should also work, but you have to do the 2 inputs in separate lines, pressing 'enter' in between.
If you deliver only one input, you'll get an error.
+ 1
Mert Yazıcı Thanks let me try
+ 1
HonFu ok thanks, it's working now, by pressing enter