Inserting characters in strings in python

后端 未结 4 2069
有刺的猬
有刺的猬 2021-02-15 11:22

I\'m doing homework and I have all except this last problem figured out. I can\'t seem to figure out how to get a character not to show up if it\'s inserted at a larger insertio

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-15 12:11

    Theres also this :)

    result = list(S).insert(P, C)
    
    if result:
        print(result)
    else:
        print(S)
    

提交回复
热议问题