字符串.replace()

phone_number='158-8888-8888'

hide_number=phone_number.replace(phone_number[:9],'*'*9)

字符串.format()

____a word she can get what she ____ for.

A.With B.came

'{}a word she can get what she{}for.'.formate('with','came')

'{0}a word she can get what she{1}for.'.formate('with','came')

'{prepostion}a word she can get what she{verb}for.'.formate(prepostion='with',vreb='came')

05-11 13:47