python截取指定字符串、替换指定字符串

2024-12-16 16:53:47
推荐回答(1个)
回答1:

notifydata = ['巴西里约奥运跳水中国包揽全部金牌', '10.10.2.95']
alias=notifydata[0]
address=notifydata[1]
print(alias, address)
alias1=alias[:4]
address1=address[6:]
print(alias1, address1)