Hi Ryan,
I see what confused you; the
"
>>> number + 1
6
>>> print number
5
"
part. Yeah, it's only evaluating the the first one. So you're asking
it "What's number + 1"?
Whereas,
>>> number = number + 1
or
>>> number += 1
Is saying "Make number equal number plus 1"
Ha, it's all a learning
> But when i use a number = number + 1
> right after the value stays the same,
I'm not sure what you mean by that.
> Now i thought that number = number + 1 just wasn't
> vailed in python untill i tried it again and it
> worked,
variable = variable + 1
is perfectly valid. It is not the normal ma
On Fri, 21 Apr 2006, ryan luna wrote:
> HA! ignore me, im stupid, XD i knew i should have waited untill morning
> =P, No bug, the number = number was just point to the old number which
> was one number lower, sorry. night =P
Get some sleep. *grin*
HA! ignore me, im stupid, XD i knew i should have
waited untill morning =P,
No bug, the number = number was just point to the old
number which was one number lower,
sorry. night =P
Oh i see someone replied -_- sorry lol
___
Tutor maillist - Tutor@py
Hey everyone, i believe i might have found a bug in
python? im not sure, heres a screen shot.
http://img151.imageshack.us/img151/4268/pythonbug8by.jpg
When i type
number + 1
and print it,
It adds one,
But when i use a number = number + 1
right after the value stays the same,
Now i thought that numb
Hi, just a recommendation: try not to assume a bug beforehand, that's a
quick way to get flames or just get plain ignored, especially in a list
for beginners.
> The * is being given equal priority to %.
>
> Why isn't % given higher priority than *?
Why should it? Doesn't it make sense that as
8*a%2
> 0
>
> The * is being given equal priority to %.
>
> Why isn't % given higher priority than *?
Because that's the way Guido designed I guess. ;-)
Although why would you expect % to be higher precedence than *?
You can always use parentheses, and if in any doubt should
do so.
> A
On 20/02/06, Kermit Rose <[EMAIL PROTECTED]> wrote:
> >>> 8*a%2
> 0
> The * is being given equal priority to %.
>
> Why isn't % given higher priority than *?
Calling it a bug is a bit harsh when it's documented that way :-)
See: http://docs.python.org/ref/summary.html
*, / and % all have the sa
>>> a = 1
>>> a2 = a%2
>>> a2
1
>>> 8*a2
8
>>> 8*(a%2)
8
>>> 8*a%2
0
>>>
The * is being given equal priority to %.
Why isn't % given higher priority than *?
Also, why am I getting a syntax error in the following?
The def in the definition of the second function is being highlighted.
IDLE