1 2 3 4 5 6 7 8 9 10 11 12 13 14
| list_ = [x for x in range(10)]
if (list_length := len(list_)) > 7: print(f"列表太长,长度:{list_length}")
list_ = [list_len:=len(list_),list_len**2,list_len**3] print(list_)
import re desc = "hwc:19" if m := re.match("hwc:(.*)",desc): print(m.group(1))
|