>>> def test():  
    i = 1  
    return i=2  
SyntaxError: invalid syntax  

原因是python 中赋值语句没有返回值,这里不是C++

相关文章: