Turning in project 1 Put your name on it! Review demo: Function that determines monitor area A little more on input: This is a function, but also a general term in Computer Science input to a program: Information which is needed before something can be performed output: Results of running some part of the program (or the whole thing) Think about devices a minute: - Input device: Mouse - Output device: In the old days, printers and displays These don't have to happen just at the beginning and end Format can require some thinking input within a program: Programs are often broken into pieces - Code re-use - Division of effort - Establishment of standards (that you don't have to think about anymore) + GNA config example - Perhaps most important: Debugging in parts - Further function examples from GNA A common mechanism for compartmentalization is functions - functions take input as parameters, or arguments - They generally don't call input, but can if this is their purpose + For example, in lab4 - "input to a function" means parameters/argument You can't think of every piece of a program at once People build stuff this way - Computers, cars, etc Designing standards: Programmers design their own little internal standards a lot Standards are useful! - Example: VGA - Example: Networking - Example: USB Standards constrain innovation - Example: VGA - Example: Networking - Example: USB Too many standards is bad - Example: Display connectors, USB output: Same thing Not always just at the end of the program There doesn't have to be any Exists within programs (output from a function) functions use return to produce output - They can also call print Function general form: def function_name(parameters): function body (possibly including a return) Further Demos: How long to guess the password with number of words? Function that converts numbers to strings with leading 0's or spaces Lists and functions: A natural combination If we have time: Memory use, and using it all up