For the use of *

Today, with re.findall () returns a List, I would like to take the first few elements

  then: 

  print(*re.findall('^[+-]?\d+',str.lstrip()))    # 42

  But on their own assignment in pycharm in GG:

  b = *re.findall('[+-]?\d+',a)                       # SyntaxError: can't use starred expression here

  

  After reading this article know,

        

 

 

 

  https://segmentfault.com/q/1010000013637464?utm_source=index-newest

 

Guess you like

Origin www.cnblogs.com/ChevisZhang/p/12243528.html