【发布时间】:2015-11-23 22:15:40
【问题描述】:
我是python的初学者,所以请多多包涵。
我正在尝试获得以下输出:
输入:apple
输出:
apple
appl
app
ap
a
我尝试过的:
b = raw_input("Enter the String")
for n in reversed(range(len(b)-1):
print b[0:n]
我在 for 循环中遇到语法错误。需要帮助。
【问题讨论】:
-
你试过数括号吗?
-
好好看看你的回溯
-
我不认为您真的希望我们与您“裸露”。 ;)