Thursday, January 6, 2011

Jan 6

Okay well today I'm gonna plan on trying to finish at least 5 pages. Right now I'm just finishing up on tuples and about to be on the unpacking section. I just finished one line of code and found out that tuples does not support append, so thats cool. I found some problems when it came to working on unpacking because instead of spacing while i was coding, I just kept the code together causing me to have to restart at least 5 times. I'm now starting on dictionaries. Okay while working with I found it quite easy until after that section was over and was on the final coding for that section. When they told me to add my_dictionary['sake']=19.95 and then put in my_dictionary it outputted {'sake': 19.949999999....}. So far I haven't found a way to fix this problem but for now I'm moving on. Okay i just finished the last of chapter 1 and will now continue on to working on chapter 2 starting at scripts.

1 comment:

  1. Ah, the joys of binary floating point numbers! The problem is that 19.95 is stored in binary, not decimal, and is thus a *repeating binary* (since .95 is not a power of 2). I usually avoid floating point numbers like the plague. Use integers instead, they are so much easier to understand.

    ReplyDelete