Re: Weired behaviour - The slice of empty string not return an error
PS: The ''[::] should return an error logically. Le dim. 30 oct. 2022 à 15:57, Yassine Nasri a écrit : > Hello, > > len('') # => 0''[0]# => error''[::] # => ''''[::] # <=> > ''[0:len(
Weired behaviour - The slice of empty string not return an error
Hello, len('') # => 0''[0]# => error''[::] # => [::] # <=> ''[0:len(''):1] the syntax of slice: slice(start, end, step) The start in ''[::] equivalent at index 0 of the '' Since the index 0 of '' returns an error. The ''[::] should not return an error logically. Best regards --