On Thu, 02 Mar 2006 20:45:10 -0500, John Salerno wrote:
> To test this out a wrote a little script as an exercise:
>
> for num in range(1, 10):
> x = 'c' * num
> y = 'c' * num
>
> if x is y:
> print 'x and y are the same object with', num, 'characters'
> el
Farshid Lashkari wrote:
> I asked a similar question a few weeks ago. I think the answers I got
> will also answer your question as well. Here's a link to the thread:
>
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/2f6f1d399ba94a7b/f564a219ffe44149?lnk=st&rnum=1&hl=en#f56
I asked a similar question a few weeks ago. I think the answers I got
will also answer your question as well. Here's a link to the thread:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/2f6f1d399ba94a7b/f564a219ffe44149?lnk=st&rnum=1&hl=en#f564a219ffe44149
-Farshid
--
http
To test this out a wrote a little script as an exercise:
for num in range(1, 10):
x = 'c' * num
y = 'c' * num
if x is y:
print 'x and y are the same object with', num, 'characters'
else:
print 'x and y are not the same object at', num,