0

How do you take multiple inputs in same line?

for eg. i do name=[int(x) for x in input ().split ()] i would like to know is there any better way to do the same?

31st Aug 2017, 3:02 PM
llGOKUll ssj
llGOKUll ssj - avatar
1 Resposta
+ 2
I would just do it more secure but it is basically the same ^^ l = input().split(" ") res = [] for i in l: try: if i[-1] in ",;": res.append(int(i[:-1])) else: res.append(int(i)) except: #here you handle errors pass
31st Aug 2017, 3:13 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar