slides10-4up[1]

slides10-4up[1] - This week in Compsci 6/101 How to build a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Compsci 06/101, Spring 2011 10.1 This week in Compsci 6/101 Review sets and lists What is a set, when is it useful What operations available on sets New APTs, some of which leverage sets Others use while loops, danger here? What is a mastery APT? Hangman assignment: understanding modules What we're doing this week, lead into cheating hangman Compsci 06/101, Spring 2011 10.2 How to build a program Create a module Can be used by other modules via import Collection of functions, later collection of classes How do the functions in one module communicate? Sometimes functions in one module interact Easy if one function calls another Harder if state must be saved between function calls Enter global variables (not used in Hangman) The scourge of human kind Compsci 06/101, Spring 2011 10.3 Programming Style Functions return a value If they don ` t they do anyway: None Sometimes it's ok not to, the function has a side effect
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/17/2012 for the course COMPSCI 6 taught by Professor Duvall during the Spring '08 term at Duke.

Page1 / 2

slides10-4up[1] - This week in Compsci 6/101 How to build a...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online