Question #313062

a = [int(i) for i in input("Enter list of numbers: ").split()]

please explain this line in detail


Expert's answer

#First input function accept user input
#Then split function creates a list of characters from the user input
#Next the int function converts all the character to integers using the for loop
a = [int(i) for i in input("Enter list of numbers: ").split()]

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS