On 24/10/2012 00:24, Nitin Ainani wrote:
Dear Sir/Madam,

I am  new to python I have a question. It is as follows:

Suppose *s* is a variable and *s* stores empty string

Pythonistas prefer the use of name and not variable.


s=""
Now if we write following statement


print(s[0])      # it gives error


print(s[0:])    # it does not give error
print (s[13:13])   # this too does not give erro
why?

This was the design decision made by Guido van Rossum many, many years ago.

Other people have already given you other answers on the other thread that you started with the same question but a different subject, please don't do that, thanks.


Regards,
Nitin


--
Cheers.

Mark Lawrence.

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to