starmap does not work | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
28th Apr 2020, 6:00 AM
Oma Falk
Oma Falk - avatar
2 Answers
+ 2
It's because of the round parentheses. This will work: list(starmap(op,[(m,),(n,)])) (m) is an expression that results in m, so starmap treats it as an iterable that needs unpacking and tries to pass all letters as function arguments individually. (m,) is a tuple that contains only m, so it is passed to the function as a single string.
28th Apr 2020, 6:31 AM
Tibor Santa
Tibor Santa - avatar
+ 3
Tibor Santa bad trap😱😱😱 Thank u
28th Apr 2020, 7:32 AM
Oma Falk
Oma Falk - avatar