Saturday, April 9, 2011

Tips and Tricks

So I've learned that in control statements:
if nodeA and nodeB are equal to 4
then this statement:
if nodeA and nodeB == 4
doesn't work you to write it like this:
if nodeA == 4 and nodeB ==4:
...

working on homework on a saturday makes me feel really good. its quiet too

"He needs to stop always seeing things for what they are, and learn to occasionally look at things for what they could be."
--some successful guy


sets are pretty useful in making comparisons:


Union: combines two sets and takes out all the duplicates
(think of build a super car from two different cars you're looking at feature wise)

Intersection: what are the common things between two sets and leaves out the differences
(think okay this honda and this toyota both have a cd player, they both have etc)

Symettric difference: what are the differences and only the difference between two car models

difference of two sets: how does one car excel in it's features over another car i.e. what does it have that the other car doesnt (not thinking about what the other car has and this car doesnt, kinda like playing to your strengths. I'm a differece of two sets kinda thinker...got to play to your strengths


less than or equal to in python is >= NOT =>


sometimes i feel that python is like an automatic machine gun in the way the language is so advanced.
i haven't learned C but maybe that would be like a manual transmission car the way it's older and yet gives you more control over the language. (i.e. in C you don't have garbage collection)


sometimes i feel like to catch tough errors you just have to write certain sections of code from scratch again


assignment finished

No comments: