On 10/06/17 17:39, Vikas YADAV wrote:
> Question: Why does "123"[::-1] result in "321"?
>
> MY thinking is [::-1] is same as [0:3:-1], that the empty places defaults to
> start and end index of the string object.
Did you try that? You may be surprised.
The wonderful thing about the >>> prompt is
It's really awkward the way you're using Counter here... you're making new
instances in every lambda (which is not great for memory usage), and then
not actually using the Counter functionality:
return sum(1 for _ in filter(lambda x: Counter(word) == Counter(x.strip()),
fileContent))
(the
Question: Why does "123"[::-1] result in "321"?
MY thinking is [::-1] is same as [0:3:-1], that the empty places defaults to
start and end index of the string object.
So, if we start from 0 index and decrement index by 1 till we reach 3, how
many index we should get? I think we should get
On 10/06/17 08:35, Abdur-Rahmaan Janhangeer wrote:
> take a look at numpy
It seems he already has, np.array is in his code.
It's just the imports that are missing I suspect.
> and don't necessarily give us the whole code. it becomes too long without
> purpose
Yes although in this case it does
take a look at numpy
and don't necessarily give us the whole code. it becomes too long without
purpose
Abdur-Rahmaan Janhangeer,
Mauritius
abdurrahmaanjanhangeer.wordpress.com
On 6 Jun 2017 03:26, "syed zaidi" wrote:
hi,
I would appreciate if you can help me