Answer to Question #313062 in Python for kittu

Question #313062

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

please explain this line in detail


1
Expert's answer
2022-03-17T06:42:42-0400
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS