Computer Science 1026A/B Lecture Notes - Lecture 5: Global Variable, Entire Function, Local Variable

43 views14 pages
terubarenuka and 39895 others unlocked
COMPSCI 1026A/B Full Course Notes
26
COMPSCI 1026A/B Full Course Notes
Verified Note
26 documents

Document Summary

: def: a sequence of instructions with a name. : you call a function in order to execute its instructions. : arguments are values entered in the calling of a function, they are values for which we want to compute a result. : not necessarily inputs provided by a human user. : a function may receive multiple arguments, or no arguments. :the return value of a function is returned to the point in your program where the function was called. :we must assign a variable to store a return value. Do not confuse returning a value with producing program output (which is produced when using a print() statement) : for example price = round(6. 875,2) print(price) we call the round function our argument is: (6. 875,2) our return is: (6. 88), and assigned to the variable price" our program output statement is : print(price) : as a user of the function, you don"t need to know how the function is implemented.

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

Related Questions