Taking input in Pyhton

invalid literal for int() with base 10: ‘5 3 4’

I am receiving this error while trying to take in three different inputs in python.
Code:-
k = int(input())
d0 = int(input())
d1 = int(input())

1 Like

if u want input as space separated in single line as - 1 2 3 4 and as array then -

ls = list(map(int,input().split(' ')))

if u want to take input a and b in a single line a , b = 1 2

then do this

a , b = map(int,input().split(' ')
5 Likes

UsserInput=int(inputs(" Enter any number"))
Print (UsserInput)

This is invalid for the question asked
@divyanshkushwa

1 Like