📌  相关文章
📜  从字符串中删除字符 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:32.925000             🧑  作者: Mango

代码示例6
def replace_(input_:str,latter:int):
    name_ = ""
    checkList=[]
    for num in range(latter):
        checkList.append(num)
    for i in range(0, len(input_)):
        if i not in checkList:
            name_ = name_ + input_[i]
    return  name_

name_=replace_("give hello",5)
print(name_) #will print hello