On 02/04/2013 12:52 PM, Ghadir Ghasemi wrote:
hi guys, this is the first bit of my program converting from binary to decimal
without use of built in functions.
binnum = input("Please enter a binary number: ")
decnum = 0
rank = 1
for i in reversed(binnum):
decnum += rank * int(i)
ran
why is this:
>>> d = 2
>>> d *= 3 + 4
>>> d
14
not this:
>>> d = 2
>>> d = d * 3 + 4
>>> d
10
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor