正文

1. 如果用Python中的内置函数来表示sign函数(即符号函数),可以写成: ```python def sign(x): if x > 0: return 1 elif x < 0: return -1 else: return 0 ``` 2.