IFB104 Lecture Notes - Lecture 3: Computer Language, Integration Testing, Global Variable

133 views3 pages
8 Nov 2018
School
Course
Professor

Document Summary

Topic 3 - how to create reusable code. Functions and modules are the standard mechanisms for making reusable code. Functions: a function is a named, parameterised sequence of statements. We can refer to a function by its name to invoke or call it. The statements forming the function"s body determine what it does. The parameters allow us to customise the function"s behaviour when we call it. Functions give us a way of structuring large programs: most programs are broken down into several distinct functions (at least, the non-trivial ones are, packaging groups of related functions into importable modules extends our computer language. Functions must be defined before they can be called. Example of defining and calling a function: a function definition introduces a new function with a name, optional parameters and a body. "def" assigns the function a definition command, then the name follows it.

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