Hello. I've been a member of this group for a very long time and have
played with Python for years, but have never gotten past being a beginner
for various reasons. I just discovered a very good, free book, that is
answering many of the questions I have had in the past that I never got
answers I
On Sat, Sep 19, 2015 at 3:29 AM, Ahmed AL-Masri
wrote:
> Dear fellows,
> I have a project for
> ...
>
Dear Ahmed,
Sorry, I do not have an answer for your question, but I did want to point
out that we are not all 'fellows' here :)
--
Deb Wyatt in WA
_
Scrambled on gmail here too.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
It seems every book I read these days uses camel case for variable names in
Python. I was once told that using underscores is preferred. Is there a
preference in the Python community or does it really matter? I'd like to
instill good habits while I'm learning.
Thanks in advance,
--
Deb Wyatt i
>
pow(-3, 2)
> 9
>
> I'm explicitly telling Python I want the value -3 raised
> to the power 2.
>
>
> Alan G
so passing any numeric expression in a function is like putting ()
around it, correct?
Thank you for demoderating me :).
--
Deb Wyatt in WA
_
so I 'get' that -5**2 = -25 and (-5)**2 is 25, BUT if you write a function
def sq(x):
""" Output: sq returns the square of its input
input x: a number (int or float)
"""
return x**2
and pass it a negative number it handles it as though the argument is
in parentheses.
I find this conf
I clearly remember that the standard for Python was to use 2 spaces
for indentation of blocks. Now Pep 8 says 4. When did that change?
I hate it when things change on me like that. And what else has
changed?
Then again, maybe I dreamed it. Am I crazy? TIA
--
Deb Wyatt in WA
___
I just looked it up. it means Looks Good to Me.
On Sat, Aug 1, 2015 at 10:16 AM, Steven D'Aprano
wrote:
> On Sat, Aug 01, 2015 at 04:53:45PM +0100, Mark Lawrence wrote:
>
> > LGTM.
>
> Let's Get The Money?
>
> --
> Steve
> ___
> Tutor maillist - Tu
>
> According to Wikipedia:
>
> https://en.wikipedia.org/wiki/Order_of_operations
>
> some scientific journals now treat multiplication as a higher precedence
> than division with a / so that 1/2x equals 1/(2x), not (1/2)x.
>
> There's an interesting study done here:
>
> "Developer beliefs about b
>
> This matches the precedence rules for written mathematics, where negation
> has a lower precedence than exponentiation as well. So python is doing the
> correct thing here mathematically. See, for example,
> http://mathforum.org/library/drmath/view/53194.html
> __
>
> Mathematically, this is perfectly acceptable, and what we would
> normally expect. In algebra, if we write:
>
> -x²
>
> we normally mean the negative of (x squared), not (negative x) squared,
> which would be just x². So Python here agrees with standard mathematical
> notation.
>
>
> Speaking
>
> He is quite within his rights to do that. It's his language after all.
> Some languages solve these problems by not permitting infix notation,
> so in Lisp for example
>
> (3 - 5)
>
> is illegal, you need to do
>
> (- 3 5)
>
> It looks odd to us but that's not the point, its how the language w
I just read in a book a little while ago that ** trumps a negative
sign? I am struggling with the audacity of that as -1 is negative 1,
NOT minus 1. How can an arithmetic operation trump an attribute of a
negative integer? It truly makes no sense to me. Thank you for any
enlightenment you can p
13 matches
Mail list logo