On Sat, 17 Dec 2016 11:10:22 -0800, John wrote:
> Hi,
>
>I am new to Python, and I believe it's an easy question. I know R and
>Matlab.
>
>
x=[1,2,3,4,5,6,7]
x[0]
> 1
x[1:5]
> [2, 3, 4, 5] *
>
> My question is: what does x[1:5] mean? By Python
In this snippet:
import sys
PY3 = (sys.version_info[0] >= 3)
def print_no_nl (s):
if PY3:
print (s, end="")
else:
print (s),
I'm getting a syntax error in Python2. Python3 is fine.
How can I make this Py2+3 compatible?
--
https://mail.python.org/mailman/listinfo/python-
On 18 December 2016 at 13:25, ElChino wrote:
> In this snippet:
> import sys
> PY3 = (sys.version_info[0] >= 3)
>
> def print_no_nl (s):
> if PY3:
> print (s, end="")
> else:
> print (s),
>
> I'm getting a syntax error in Python2. Python3 is fine.
> How can I make this Py
Chris Warrick wrote:
>> I'm getting a syntax error in Python2. Python3 is fine.
>> How can I make this Py2+3 compatible?
>
> With a __future__ import, the Python 3 syntax will work with both Pythons:
>
> from __future__ import print_function
> print(s, end="")
Thanks. Lovely.
--
https://mail
Hi John,
there is a nice short article by E. W. Dijkstra about why it makes sense
to start numbering at zero (and exclude the upper given bound) while
slicing a list. Might give a bit of additional understanding.
http://www.cs.utexas.edu/users/EWD/ewd08xx/EWD831.PDF
- paul
http://www.cs.utexas
On 18/12/2016 10:59, Paul Götze wrote:
Hi John,
there is a nice short article by E. W. Dijkstra about why it makes sense
to start numbering at zero (and exclude the upper given bound) while
slicing a list. Might give a bit of additional understanding.
http://www.cs.utexas.edu/users/EWD/ewd08xx/
On Sun, 18 Dec 2016 16:21:20 +, BartC wrote:
> On 18/12/2016 10:59, Paul Götze wrote:
>> Hi John,
>>
>> there is a nice short article by E. W. Dijkstra about why it makes
>> sense to start numbering at zero (and exclude the upper given bound)
>> while slicing a list. Might give a bit of additi
On 12/18/2016 09:21 AM, BartC wrote:
> On 18/12/2016 10:59, Paul Götze wrote:
>> Hi John,
>>
>> there is a nice short article by E. W. Dijkstra about why it makes sense
>> to start numbering at zero (and exclude the upper given bound) while
>> slicing a list. Might give a bit of additional understa
On 15/12/2016 18:05, Peter Pearson wrote:
On Wed, 14 Dec 2016 11:50:30 -0600, Skip Montanaro wrote:
On Wed, Dec 14, 2016 at 11:40 AM, Peter Pearson
wrote:
Train your fingers to use C-[.
As I recall, the location of the Ctrl key was one of the differences
between Sun and PC101 keyboards. Does
> +1 for knowing where CTRL should be.
Bonus +1 for having used an ASR33.
;-)
I'm sure I must have used an ASR33, but can't recall what it might have
been connected to. I do remember using card punch machines for IBM 360
input in 1972 at USC, and toggling front panel switches for binary input on
mm0fmf wrote:
+1 for knowing where CTRL should be.
Bonus +1 for having used an ASR33.
And it's quite remarkable that the designers of the ASR33
knew exactly where it would need to be for Emacs users
years later! I think Richard Stallman must have a time
machine as well.
--
Greg
--
https://mail
Dennis wrote:
"
Instead you /now/ have ONE set of R marching down FOUR sets of B
RT RD RF RP <-
attackers
BT BF BF BP
round 1
BF BD
On 18Dec2016 16:21, BartC wrote:
On 18/12/2016 10:59, Paul Götze wrote:
there is a nice short article by E. W. Dijkstra about why it makes sense
to start numbering at zero (and exclude the upper given bound) while
slicing a list. Might give a bit of additional understanding.
http://www.cs.utex
On 18/12/2016 21:04, Michael Torrie wrote:
On 12/18/2016 09:21 AM, BartC wrote:
So if you wanted a simple list giving the titles of the chapters in a
book or on a DVD, on the colour of the front doors for each house in a
street, usually you wouldn't be able to use element 0.
It also depends
On 18/12/2016 22:21, BartC wrote:
On 18/12/2016 21:04, Michael Torrie wrote:
On 12/18/2016 09:21 AM, BartC wrote:
So if you wanted a simple list giving the titles of the chapters in a
book or on a DVD, on the colour of the front doors for each house in a
street, usually you wouldn't be able t
NOTE: If you found this message by searching for help on how Python
works, be aware that it's discussing how JavaScript works, not Python!
Look elsewhere :)
Chris, this isn't directed at you (I think you get it) - just following
up with some detail for anyone who might discover this sub-thre
On Mon, Dec 19, 2016 at 9:52 AM, Erik wrote:
>
> 1) Method call:
>"obj.foo(1, 2, 3)" is syntactic sugar for "obj.foo(obj, 1, 2, 3)".
And the bit you have to be REALLY careful of when working with both
Python and JS is that you have to have "obj.foo(...)" as a single
expression. Consider:
# P
BartC writes:
> On 18/12/2016 10:59, Paul Götze wrote:
>> there is a nice short article by E. W. Dijkstra about why it makes sense
>> to start numbering at zero (and exclude the upper given bound) while
>> slicing a list. Might give a bit of additional understanding.
>>
>> http://www.cs.utexas.ed
Hi, I'm learning python and full of extensive tutorials around. Getting a bit
lost and overflowed in my head with tuples, dictionaries, lists, etc ... etc...
Everything great, but I'd like to perform some basic task while learning the
rest. For example, I'm having a hard time to find some practi
19 matches
Mail list logo