+ 3
how to split integer inputs from the same line and put them in integer list ?
example input = 1 2 3 4 5 output = [1, 2, 3, 4, 5] ie list of integers i tried a = input().split() print(a) it gives output ['1', '2', '3', '4', '5'] ie it converts to list of string elements.. i want in integers..
3 Réponses
+ 2
I created a code to help you out, hope it makes sense! d:
https://code.sololearn.com/ciZWyw28Ko6R/?ref=app
+ 2
a = [ int(v) for v in input().split()]
+ 2
thanks for solution..