Course Outline - COMP150 Lectures and Labs 1 The way of the

advertisement
Course Outline - COMP150
Lectures and Labs
1 The way of the program
1.1 The Python programming language
1.2 What is a program?
1.3 What is debugging?
1.4 Experimental debugging
1.5 Formal and natural languages
1.6 The first program
1.7 Glossary
1.8 The COMP150 lab
1.8.1 Logging-on
1.8.2 The OSX desktop
1.8.3 Menus
1.8.4 The dock
1.8.5 The Finder window
1.8.6 Your home directory
1.8.7 Applications
1.8.8 IDLE
1.8.9 Getting help
1.8.10 Coursework files
1.8.11 Terms requirements
1.9 Blackboard
1.10 Laboratory exercises
2 Variables, expressions and statements
2.1 Values and types
2.2 Variables
2.3 Variable names and keywords
2.4 Statements
2.5 Evaluating expressions
2.6 Operators and operands
2.7 The modulus operator
2.8 Order of operations
2.9 Operations on strings
2.10 Glossary
2.11 Laboratory exercises
3 Functions: part 1
3.1 Composing expressions
3.2 Function calls
3.3 Function definitions and use
3.4 Flow of execution
3.5 Parameters and arguments
3.6 Function composition
3.7 Comments
3.8 Glossary
3.9 Laboratory exercises
4 Functions: part 2
4.1 Variables and parameters are local
4.2 Stack diagrams
4.3 Input
4.4 Type conversion
4.5 Glossary
4.6 Laboratory exercises
5 Conditionals
5.1 Conditional execution
5.2 Boolean values and expressions
5.3 Logical operators
5.4 Alternative execution
5.5 Chained conditionals
5.6 Nested conditionals
5.7 Booleans and type conversion
5.8 Glossary
5.9 Laboratory exercises
6 Fruitful functions
6.1 The return statement
6.2 Return values
6.3 Program development
6.4 Composition
6.5 Boolean functions
6.6 Glossary
6.7 Laboratory exercises
7 Modules and TDD
7.1 Modules, files and the import statement
7.2 Triple quoted strings
7.3 Unit testing with doctest
7.4 Good Practice Development
7.5 Test-driven development demonstrated
7.6 Programming with style
7.7 Glossary
7.8 Laboratory exercises
8 Strings part 1
8.1 A compound data type
8.2 Length
8.3 String slices
8.4 String comparison
8.5 Strings are immutable
8.6 Traversal and the for loop
8.7 The in operator
8.8 Looping and counting
8.9 str Methods
8.10 Glossary
8.11 Laboratory exercises
9 Files and modules
9.1 Files
9.2 Processing things from a file
9.3 Directories
9.4 Files as a Unifying Concept
9.5 Glossary
9.6 Laboratory exercises
10 Iteration: part 1
10.1 Multiple assignment
10.2 Updating variables
10.3 Abbreviated assignment
10.4 The while statement
10.5 Tracing a program
10.6
10.7
10.8
10.9
Counting digits
Tables
Glossary
Laboratory exercises
11 Iteration: part 2
11.1 Two-dimensional tables
11.2 Encapsulation and generalization
11.3 More encapsulation
11.4 Local variables
11.5 More generalization
11.6 Functions
11.7 Newton’s method
11.8 Algorithms
11.9 Glossary
11.10 Laboratory Exercises
12 Strings part 2
12.1 String formatting
12.2 Character classification
12.3 A find function
12.4 Optional parameters
12.5 Glossary
12.6 Laboratory exercises
13 Lists part 1
13.1 List values
13.2 Accessing elements
13.3 List length
13.4 The range function
13.5 Lists and for loops
13.6 List membership
13.7 List operations
13.8 List slices
13.9 Lists are mutable
13.10 List deletion
13.11 Glossary
13.12 Laboratory exercises
14 Lists part 2
14.1 Objects and values
14.2 Aliasing
14.3 Cloning lists
14.4 List parameters
14.5 Pure functions and modifiers
14.6 Which is better?
14.7 Nested lists
14.8 Matrices
14.9 Strings and lists
14.10 Glossary
14.11 Laboratory exercises
15 Tuples, Sets and Dictionaries
15.1 Tuples and mutability
15.2 Tuple assignment
15.3 Tuples as return values
15.4 Why tuples?
15.5 When should you use tuples?
15.6 Sets
15.7 Dictionaries
15.8 Dictionary operations
15.9 Dictionary methods
15.10 Aliasing and copying
15.11 Counting letters
15.12 Glossary
15.13 Laboratory exercises
16 No Lecture Today
16.1 No Lab This Session
17 Classes and objects - Part 1
17.1 Object-oriented programming
17.2 User-defined compound types
17.3 The init Method and self
17.4 Attributes
17.5 Methods
17.6 Sameness
17.7 Interface and Representation
17.8 Glossary
17.9 Laboratory exercises
18 Classes and objects - Part 2
18.1 Rectangles
18.2 Instances as return values
18.3 Objects are mutable
18.4 Copying
18.5 A Polygon Class
18.6 Glossary
18.7 Laboratory exercises
19 Graphical user interface programming
19.1 Event driven programming
19.2 TkInter introduction
19.3 Introducing callbacks
19.4 User input
19.5 Mini-case study
19.6 Glossary
19.7 Laboratory exercises
20 Case study: Catch
20.1 Graphics
20.2 Moving the ball
20.3 Adding randomness
20.4 Glossary
20.5 Laboratory exercises
21 Case study: Catch continued
21.1 Keyboard input
21.2 Checking for collisions
21.3 Keeping score
21.4 Glossary
21.5 Laboratory exercises
21.6 Optional extension project: pong.py
22 System programming
22.1 The sys module and argv
22.2 The os and glob module
22.3 A mini-case study
22.3.1 ImageMagick
22.3.2 Scripting ImageMagick
22.4 Glossary
22.5 Laboratory exercises
23 Case study 2 Part 1
23.1 Program Design
23.2 The Initial Program
23.3 Opening a File
23.4 Saving to a File
23.5 Adding a Command Bar
23.6 Laboratory Exercises
24 Case study 2
24.1 Encrypting
24.2 Putting it
24.3 Glossary
24.4 Laboratory
Part 2
the Contents
All Together
Exercises
25 The last lecture
25.1 Stuff we haven’t covered
25.2 What you can expect from COMP160 and Computer Science
Download