python中怎样删除空格后的所有字符,比如a=✀小王 小张✀,现在要删掉空格和小张,用replace的话该怎么写?

2025-03-18 20:52:13
推荐回答(1个)
回答1:

>>> a='小王 小张'
>>> a=a.split()[0]
>>> print a
小王