+ 1
list comprehension of multiple inputs
lt=[int(x) for x in input("ENTER : ").split()] Can anyone explain the above code, please?. Means how it works.
2 Réponses
+ 3
Input() returns a string
"string".split returns a list of characters
int() then converts all those characters into integers and stores them in the list (comprehension)
0
Thankyou sir for clarifying