Monday, January 17, 2011

Gidget's Gadget Blog - Entry #1

Today I learned to program Python! I learned that computers are very picky, because when I forgot " the computer said ERROR! I also learned that you type a math problem like16/2 the computer would give the answer 8.  I learned computer math symbols, *is the multiplication sign, - is minus, + is plus, and /is the division  sign.

I also learned if I typed print " now what I type in here, the computer types back." (after I press enter)

One of the things I did was add a math problem in with a sentence, and the computer would solve the problem and put  the answer in the  sentence.  For example, print "five times two equals" 5*2 -  the computer would write five times two equals 10 5*2= 10.

Here is one of the programs I wrote:                                                                                             #variables demonstrated
print "This program is a demo of variables"
v = 1
print "The value of v is now", v
v = v + 1
print "v now equals itself plus one, making it worth", v
v = 51
print "v can store any number to be used elsewhere."
print "for example, in a sentence. v is now worth", v
print "v times 5 equals", v*5
print "but v still remains only", v
print "to make v five times bigger, you would have to type v = v* 5"
v = v * 5
print "there you go, now v equals", v, "and not", v / 5


Dad's Take:
So we finally started working through the basics of Python together today. I had us follow an online tutorial (http://www.sthurlow.com/python/), which was a little tedious for her, since I made her type everything rather than copy/paste as it suggested. But I think that a significant part of learning this is in repetition. If Gidget keeps typing "print "blah, blah, blah"" over and over again, she will eventually remember the pattern for making the program print something. Same with the syntax for programming the computer to do math problems. She needs the repetition of  seeing that *=multiplication and / = division, to get in the habit of using those.

I find that this type of repetition is particularly useful when you are talking about programming, which is so picky about requiring that things be entered exactly in order to work. Overall, she did an excellent job and was very excited about the two programs she wrote. The first was a simple print program which made the computer output Mary had a little lamb. The second was the more complicated variable program above that incorporated print commands with variables and math problems. She wanted to keep both and has them on her desktop still.

More programming to come at a later date. But we finally got started with the blog.
Thanks to MLK day for giving us the time to sit down and work through this.

JM

No comments:

Post a Comment