即使我从代码中删除“if 语句”,我也会得到相同的输出。
word='pizza'
begin=None
while begin!='':
begin=(raw_input('\nBegin:'))
if begin:
begin=int(begin)
end = int(raw_input('End:'))
print "word[",begin,":",end,"]"
print word[begin:end]
raw_input("\n\nPress enter key")