Monday, January 31, 2011

Jan 31

OK the resources ill use for my goal will be the python book provided by the class and then ill also use the How to Think Like a Computer Scientist site. My plans are by the first week or by the second week ill be caught up on my questions with my chapters and will be well onto ether chapter 7 or chapter 8. By the third week I am planning on trying to build some sort of animation or action produced through python script. Examples are maybe making a program that allows you to press any button and then after pressing the button a animation will appear on the screen or something along those lines.
Continue onto Chapter 4 questions:
  1. >>> 5 % 2
 1
  1. >>> 9 % 5
4
  1. >>> 15 % 12
3
  1. >>> 12 % 15
12
  1. >>> 6 % 6
0
  1. >>> 0 % 7
0
  1. >>> 7 % 0
integer division or modulo by zero is the end result I get when i try to put 7%0 into python. Python does this because it cant get 7% of 0 when 0 has nothing in it.
#2: make a program
p      q     not p or q
=====================
True    True    True
True    False   True
False   True    True
False   False   False
 
p      q      p and q
======================
True    True    True 
True    False   False
False   True    False
False   False   False

p      q      not p and q
==========================
True    True    False
True    False   False
False   True    True 
False   False   False

 p      q      not(p) or not(q)
============================
True    True    True 
True    False   False
False   True    True 
False   False   True 

 p      q      not(p) and not(q)
============================
True    True    True 
True    False   False
False   True    True 
False   False   True 
After a few minutes I figured what they meant by changing "p or q" to stuff like "not p and not q".
#4:

Tuesday, January 25, 2011

Jan 24-25

 The name of my program/ goal for this quarter will be called "Something More"

 My goal for this quarter is to for one thing improve my understanding on more on what is python. I also wanna learn, instead of the code of random programs, but more of the code for design on what picture would pop up or what action the character on the screen will do if I press like for say space. I want to have a more visceral affect this quarter to where i can actually see more then just words pop up saying some random sentence. I want to try to see if I can try to build a program or just run a program that demonstrates multiple actions and/or movements of some figure on the screen.
Um ill finish up on my resources I'll b using and my time line sometime during this week.
 

Friday, January 21, 2011

Jan 21

OK well today I'm continuing on my exercises trying to catch back up to chapter 5. Um I'm starting out on chapter 2.  
#5:
float
str
'The knights who say "ni!"'
invalid syntax
'The knights who say "ni!"'
#6: bruce = 6
bruce + 4 = 10
#7: had to write a python program.
Chapter 3
#1: (I had a lot of difficulty with this question due to the fact that i instead had def new_lines(): instead of def new_line():. talk about one thing messing your program up).
def new_line():
    print
  
def three_lines():
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()

three_lines()

def clear_screen():
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
    new_line()
  
clear_screen()
#2: When I move clear_screen() to the top of the program I get: Invalid syntax error.
#3: With me moving new_line() around the program, I got errors saying that new_line() is not defined and Invalid syntax.
Um ill continue this next week, I've learned from the program on #1, is that 1 error can cause everything to mess up no matter how small the error is.

Thursday, January 20, 2011

Jan 20

Alright today I'm gonna review the first few chapters that I have done on the How to Think Like a Computer Scientist site, i'll do a quick read through then add my exercises to this.
 Chapter 1 Exercises:
#1: print "hello, how are you"
print "Hello, how are you?"
#2: When I add the / into an equation, it causes the equation to divide. Like for example: 2 + 2 will equal 4, but when u substitute + for / you'll get 1 instead of 4. This is caused by the problem changing from a addition problem to a division problem.
#3: more examples of errors are:
2 3 invalid syntax
3***2 invalid syntax
ill stop at two examples because I've come to notice that all the numbers that I apply to python without accurate equation symbols will end in a invalid syntax error.
#4: When I added the " " into print "hello" I got the same results as I did for when I put in print 'hello'. I got hello without any quotation marks.
#5: no question for this one
#6: This one is to make a test1.py file
OK well that wraps up chapter 1.
Chapter 2 Exercises:
#1: When I code: print n = 7, I get a syntax error saying that its a invalid syntax. When I apply print 7 + 5 I get a end result of 12. I also had to print 5.2, "this", 4 - 2, "that", 5/2.0 and got 5.2, this, 2, that, and 2.5. I noticed that even though, without adding quotations to like 7+5 to get 7+5 as a end result instead of getting 12. I could also instead of putting print 7 + 5, I could simply just put in 7 + 5 to get the end result of 12.
#2: n = "All work and no play "
p = "makes Jack a dull boy."
n + p = "All work and no play makes Jack a dull boy."
#3: To make 6 * 1 - 2 equal -6 then 4, u add parenthesis where 6*(1-2) so that after 2 is taken from 1 you get -1. Then -1 * 6 will equal -6.
#4: When I add a comma in front of n + P from question #2, I get a syntax error. Python response by saying that the comma is a invalid syntax.
Um due to time, ill continue this next class from question #5. 

Wednesday, January 19, 2011

Jan 19

Alright I'm gonna start this week of by finishing up on the last bits on chapter 4 on the How to Think Like a Computer Scientist. I'm basically done with this chapter, I'm on 4.7 Nested Conditionals. Um I think I may double back on some of the chapters on the How to Think Like a Computer Scientist site. Just so that I can remember more of those terms.

Friday, January 14, 2011

Jan 14

OK well I'm switching back to the Internet site to practice more on python. I'm just finishing up on chapter 3 and gonna start on 4 and see whats gonna happen then.

Thursday, January 13, 2011

Jan 13

Um well today I'm gonna try the book again to see how I do. Gonna try to get a few pages done.