>>> aaa
=
"wade,james,kobe,lewis,kevin"
>>> s
=
aaa.replace(
"james"
,
"curry"
)
'wade,curry,kobe,lewis,kevin'
>>>
type
(s)
<
class
'str'
>
>>> champions
=
'warriors,spurs,heat,heat,mavericks,lakers,lakers,celtics,spurs'
>>> champions.replace(
"spurs"
,
"马刺队"
,
1
)
'warriors,马刺队,heat,heat,mavericks,lakers,lakers,celtics,spurs'
>>> champions.replace(
"spurs"
,
"马刺队"
,
2
)
'warriors,马刺队,heat,heat,mavericks,lakers,lakers,celtics,马刺队'