0

I am stuck at line 196 of this Github code.

li.append((1.0, *update_probability_matrix(row, col, a)))

I am not able to understand, why is * associated with update_probability_matrix(row, col, a). What is the meaning in Python when we add star to a function?

Anwesa Roy
  • 67
  • 1
  • 10
  • The above two articles don't answer my question. I have an asterisk in front of a function. What they have discussed is something else. – Anwesa Roy Apr 09 '22 at 04:00
  • Your function return some value and the * here works on them, see the example: https://stackoverflow.com/a/36908/11318161 – Ali Rn Apr 09 '22 at 04:06
  • It doesn’t matter what it’s in front of, it matters what it’s inside. You’re right that those aren’t correct exact duplicates, though; this is unpacking inside a tuple literal, not a function call. – Ry- Apr 09 '22 at 04:06
  • https://docs.python.org/3/whatsnew/3.5.html#whatsnew-pep-448 – Ry- Apr 09 '22 at 04:08

0 Answers0