This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rdhunkins
Recipients rdhunkins
Date 2017-09-19.14:51:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1505832670.28.0.985566870824.issue31519@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,
I'm only a novice with Python, so please take it easy on me if I have transgressed.

I am using Python 3.6.2 on a win10 64 bit machine, and entered this:

>>> a= [-1 ** x for x in range(1,10)]
>>> print(a)
[-1, -1, -1, -1, -1, -1, -1, -1, -1]
which is not correct.

however, entering this:

>>> b = [pow(-1, x) for x in range(1,10)]
>>> print(b)
[-1, 1, -1, 1, -1, 1, -1, 1, -1]

which is correct.
Any negative number entered and raised to an even power seems to not return a positive value, but the pow(x,y) function works.

I never have reported a bug on any programming language ever, and surprisingly I can't find a report of this (I did search, so if it's out there, I must not understand how to use the search. Forgive me. As I said, I'm very new to Python and I'm not a professional programmer.)
History
Date User Action Args
2017-09-19 14:51:10rdhunkinssetrecipients: + rdhunkins
2017-09-19 14:51:10rdhunkinssetmessageid: <1505832670.28.0.985566870824.issue31519@psf.upfronthosting.co.za>
2017-09-19 14:51:10rdhunkinslinkissue31519 messages
2017-09-19 14:51:10rdhunkinscreate