Python中代字号运算符的用法是什么?
我能想到的一件事是在字符串或列表的两边做一些事情,比如检查字符串是否是回文符号:
def is_palindromic(s): return all(s[i] == s[~i] for i in range(len(s) / 2))
还有其他好用吗?
python operators
operators ×1
python ×1