On Wed, Apr 17, 2013 at 7:40 AM, Walter Hurry wrote:
> On Wed, 17 Apr 2013 01:30:03 +1000, Chris Angelico wrote:
>
>> By the way, regarding your email address: there are no cheat codes in
>> Python
>
> ROFLMAO. Incidentally, my son used to use IDDQD rather than IDKFA.
>
> I of course spurned all s
On Wed, 17 Apr 2013 01:30:03 +1000, Chris Angelico wrote:
> By the way, regarding your email address: there are no cheat codes in
> Python
ROFLMAO. Incidentally, my son used to use IDDQD rather than IDKFA.
I of course spurned all such, since I preferred to do it the hard way.
Thus I was Doomed.
On 2013-04-16, Lele Gaifax wrote:
> Neil Cerutti writes:
>
>> Imagine something like the following for loop taking place
>> somewhere:
>>
>> for (int i = 2; i <= 0; --i) {
>> fprintf(a[i]);
>> }
>
> Neil most probably meant
>
> for (int i = 2; i >= 0; --i) {
> fprintf(a[i]);
> }
>
> where
Neil Cerutti writes:
> Imagine something like the following for loop taking place
> somewhere:
>
> for (int i = 2; i <= 0; --i) {
> fprintf(a[i]);
> }
Neil most probably meant
for (int i = 2; i >= 0; --i) {
fprintf(a[i]);
}
where "fprintf" is actually a fictitious "do_something" functi
On 2013-04-16, idkfaidkfaid...@gmail.com wrote:
> Hi all,
> i'm programming in python for the first time (usually i use C as programming
> language). I don't understand these results:
>
a=[1,2,3,4,5]
a[:-1]
> [1, 2, 3, 4]
a[::-1]
> [5, 4, 3, 2, 1]
a[2::-1]
> [3, 2, 1]
The thi
When slicing: l[start:end:step]
In your example of "a[2::-1]" you are reversing the list by using a step of
-1, then you are slicing at index 2 (third element).
*Matt Jones*
On Tue, Apr 16, 2013 at 10:30 AM, Chris Angelico wrote:
> On Wed, Apr 17, 2013 at 1:20 AM, wrote:
> > Hi all,
> > i'm
On Wed, Apr 17, 2013 at 1:20 AM, wrote:
> Hi all,
> i'm programming in python for the first time (usually i use C as programming
> language). I don't understand these results:
>
a=[1,2,3,4,5]
a[:-1]
> [1, 2, 3, 4]
a[::-1]
> [5, 4, 3, 2, 1]
a[2::-1]
> [3, 2, 1]
>
> what does a