Help: new_word=[1:len(new_word)] didn't work


when I code as below,

new_word=[1 : len(new_word)]

it returns an error: SyntaxError: invalid syntax…
does I code wrong? please help…


and the Syntax Error is at the colons…


the general syntax for string slicing is:


you don’t have the string before the square opening bracket, so python is unaware of what it should take a slice, so it throws an error


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.