0

I have started practicing for python when I came across the term "*map()" and I'm not able to understand what it means. I know the map function allows us to take multiple inputs as it is self iterable but was is the use of the asterisk(*) in front of it.

import numpy
print(str(numpy.eye(*map(int,input().split()))).replace('1',' 1').replace('0',' 0'))
Andrej Kesely
  • 168,389
  • 15
  • 48
  • 91
Karthik K
  • 37
  • 1
  • 6
  • @hmm "This question is a very popular duplicate target, but unfortunately it's often used incorrectly. Keep in mind that this question asks about defining functions with varargs (`def func(*args)`). For a question asking what it means in function calls (`func(*[1,2])`) see [here](https://stackoverflow.com/questions/5239856/asterisk-in-function-call)." – John Kugelman May 11 '20 at 15:01
  • @JohnKugelman Oops, missed that! The [second answer](https://stackoverflow.com/a/36926/12155142) does seem to answer the question though. – chash May 11 '20 at 15:09

0 Answers0