我被困在这上面,我不知道该怎么做。
# returns a string that changes all occurrences of its first char have been changed to '*'
def fix_start(str):
results = []
str.startswith(str[1])
results =
例如:给定字符串=' bubble'它应该返回:bu ** le
答案 0 :(得分:7)
def fix_start(s):
return s[0]+ s[1:].replace(s[0],'*')