CS 111 - 2/8/18 Variable Scope - the area of code in which a variable is usable Local variables are only usable/valid inside of the function in which they are defined. When a variable is sent to another function via a parameter, the values of variable are also usable in the other function; however, the name of the variable is replaced with the name specified in the function's parameter list. def print ( value ): do what is needed to print the value def function1(): var1 = 10 print ( var1 ) def function2(): var1 = 5 print ( var1 ) def teach ( prof ): dosomething ( prof ) def reviewHomeworkWithChild ( dad ): dotask ( dad ) def dailyTasks (): pat = makePerson() teach ( pat ) reviewHomeworkWithChild ( pat ) bob = makePerson() teach ( bob ) reviewHomeworkWithChild ( bob ) Other turtle functions getXPos( t ) return the X coordinate of the turtle's position on the coordinate axis getYPos( t ) return the Y coordinate of the turtle's position on the coordinate axis moveTo (t, x, y) move the turtle to the position (X, y) on the coordinate axis The upper left corner of the picture/world is position (0, 0) The positive X direction is to the right The positive y direction is down Colors - made up of 3 integer values makeColor ( r, g, b) r - the amount of red in the color g - the amount of green in the color b - the amount of blue in the color The valid values for r, g and b range from 0 to 255 inclusive A 0 value indicates no amount of that color is present A 255 value indicates the maximum amount of that color is present