Home > other >  Question: in python map and the use of the list
Question: in python map and the use of the list

Time:10-03

N=list (map (int, input (). The split ()))
N=map (int, input (). The split ())
N=int (input ())
N=input ()
What's the difference?
A layer of a layer set, it's too hard to

CodePudding user response:

It's not just math first and the same in brackets,
First you need to know what this a few function is
The map function of two parameters, the first is the function name, his role is to the second parameter as the parameters of the first function to perform,
Int, the list is the parameter type, number and type of list, parentheses to perform first, then perform the function outside the parentheses, did you watch is easy to separate

CodePudding user response:

First find the innermost parentheses, also can take you to see,

 n=list (map (int, input (" please enter: "). The split ())) 


First input () input, and then the split () to empty, and then converted to int integer, again into the list list



  • Related