CSC108H1 Lecture Notes - Lecture 2: Docstring, Memory Address
yifanyang and 39659 others unlocked
21
CSC108H1 Full Course Notes
Verified Note
21 documents
Document Summary
#adjust course grades by multiplying by 1. 2 and adding 3 def adjust_grade(original_grade): return 1. 2 * original_grade + 3 x=3 type(x) Parameter variable, get it"s value when the function is used. The memory address of the object that contains the value of the adjusted grade is returned. The values 80, 0, 75 are examples of arguments to the function. They are used to give a value to the parameter when called and evaluated. Find the distance from the point (x,y) to the origin. Examples: write one or two examples that demonstrate the use of the function and show the expected return value. Type contract: describes the type of the parameters and the type of the value returned. Function header: above the docstring, choose a meaningful name for function and parameters. Describe what the function does, and mention each of the parameters by name, not how the function does the work. Return the distance from coordinate (x,y) to the origin description.