[Tutor] Book recommendation
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 could understand from you all. While I appreciate the time and effort you put in helping us out, most of you do not remember what you didn't used to know, and are often less than helpful because of this. This is not meant as a criticism, but just my observation. Anyway, this book I found, Learning Python, is well-written and easy to understand. Here is a url to it.https://www.packtpub.com/tech/python. no affiliation, etc, I just wanted to share this great resource. I am finding this book so easy to read I am reading it instead of my usual non-fiction. -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] Opencv
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 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] About using list in a function
Scrambled on gmail here too. ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] variable naming conventions
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 in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] revisiting a puzzle about -3**2 vs (-3)**2
> 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 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] revisiting a puzzle about -3**2 vs (-3)**2
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 confusing. Can someone explain? Also, can someone please take me off moderated? thanks in advance. -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] Pep 8, about indentation
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 ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] OT: Test to see if ibisMail app is truly sending in plain text
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 - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor > -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] a puzzle about -3**2 vs (-3)**2
> > 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 binary operator precedence" > > http://www.knosof.co.uk/cbook/accu06.html > > which suggests that even professional programmers get operator > precedence wrong at a high rate. (The study found a 33% error rate.) > > The bottom line is, there is no universal right or wrong answer for the > precedence rules for operators, although some rules are less right than > others. > > > > -- > Steve Interesting info. Thanks for following up on this. -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] a puzzle about -3**2 vs (-3)**2
> > 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 > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor That is just so counterintuitive, and I've never run into this in any mathematics I have taken. Now I'm going to have to research this further, from a mathematics standpoint. -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] a puzzle about -3**2 vs (-3)**2
> > 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 as a maths tutor with about 20 years experience, and a B.Sc. > with a major in mathematics, I'm not sure I understand what you are > getting at. There is no mathematical difference between the inherent > negativeness of -1 and the arithmetic operation - 1 (unary minus > operator followed by 1). > > Whichever way you treat it, we have to agree what it means. For example, > 2x means 2 multiplied by x; but 23 doesn't mean 2 multiplied by 3. It > could if we wanted it to, but that would be inconvenient. Mathematicians > could define -3² as (-3)² = 9 if they wanted to, but generally they > don't, although there are exceptions. Consequently such expressions are > ambiguous and are best avoided. Although -x² never means -x squared, > it always means minus (x squared). > > > -- > Steve I have never really thought about any of this before, but many of you have responded like this is so obvious. That is not helpful. I'm looking at a negative number as being an object that is one less than zero, and the unary sign being a part of that object, glued to it. Why is that so hard to understand? So, mathematically, it works the way python works. I never realized that, though I've always been good at math. It's just not something that has ever explicitly come up anywhere until I read it in the Python book. The whole purpose of this email group is to share knowledge and help each other, but when you forget that what seems obvious to you is not obvious to everybody, you lose the ability to be as helpful as you could be. I'm sorry my question turned out to be more about math than Python. I had no idea. This semi-rant is NOT directed at you, personally, Steve. I would like to thank almost everybody for their responses. I've learned a few things. But I'll keep asking questions anyway, even if some of your responses imply they're stupid questions. The only stupid question is the question you don't ask. -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
Re: [Tutor] a puzzle about -3**2 vs (-3)**2
> > 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 works. > You learn to get used to it. Most languages have some idiosyncrasies like > this. > > HTH > > -- > Alan G > Author of the Learn to Program web site > http://www.alan-g.me.uk/ > http://www.amazon.com/author/alan_gauld > Follow my photo-blog on Flickr at: > http://www.flickr.com/photos/alangauldphotos > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > https://mail.python.org/mailman/listinfo/tutor Yes, I understand that the creator of the language can make it work however he wants, but I was really hoping for a logical answer. Just because 'that's the way it is' kind of sucks and will make it more difficult to remember. -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
[Tutor] a puzzle about -3**2 vs (-3)**2
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 provide. Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> 3**2 9 >>> (-3)**2 9 >>> -3**2 -9 >>> -- Deb Wyatt in WA ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor