【发布时间】:2021-02-14 21:25:05
【问题描述】:
我需要接受用户输入,例如:whacky 和 2,并且输出需要是 whky
我知道你用
分割字符串s[start:stop:skip]
但我不确定如何实现我的目标。
【问题讨论】:
-
s[:2] + s[-2:] -
这能回答你的问题吗? Remove char at specific index - python
标签: python