可以用re功能。
import reword = "u=1614751613,3991402519&fm=27&gp=0.jpg"print(re.sub("[=,&]", "", word))
输出:u16147516133991402519fm27gp0.jpg