CSC108H1 Lecture Notes - Lecture 2: Docstring, Memory Address

58 views2 pages
10 Apr 2016
School
Course
yifanyang and 39659 others unlocked
CSC108H1 Full Course Notes
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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents