Difference between revisions of "CSC111 Class Page 2018"
(→ ) |
|||
(223 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
<br /> | <br /> | ||
__NOTOC__ | __NOTOC__ | ||
− | <center>[[CSC111 2018 | Main Page]] | [[CSC111_Syllabus_2018 | Syllabus ]] | [[CSC111_Class_Page_2018 | Weekly Schedule ]] | [[CSC111_Class_Page_2018#Links_and_Resources | Links & Resources ]] |[https://piazza.com/smith/ | + | <center>[[CSC111 2018 | Main Page]] | [[CSC111_Syllabus_2018 | Syllabus ]] | [[CSC111_Class_Page_2018 | Weekly Schedule ]] | [[CSC111_Class_Page_2018#Links_and_Resources | Links & Resources ]] |[https://piazza.com/smith/spring2018/csc111/home Piazza] | [http://www.science.smith.edu/classwiki/index.php/Computer_Science_TA_hours TA Hours] </center> |
<br /> | <br /> | ||
---- | ---- | ||
+ | <br /><br /> | ||
+ | <center> | ||
+ | [[CSC111_Final_Exam_2018 | Final Exam]] | ||
+ | </center> | ||
<br /><br /> | <br /><br /> | ||
==== ==== | ==== ==== | ||
Line 102: | Line 106: | ||
|} | |} | ||
<br /> | <br /> | ||
− | ::{| class="mw-collapsible" style="width:100%" border="1" | + | ::{| class="mw-collapsible " style="width:100%" border="1" |
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
|width="60%"| '''Topics''': Chapter 2: variables, definite loops, input, the range function | |width="60%"| '''Topics''': Chapter 2: variables, definite loops, input, the range function | ||
Line 110: | Line 114: | ||
| | | | ||
* '''Monday''' | * '''Monday''' | ||
+ | ::* ''Counted'' loops and the ''range()'' expression | ||
::* Getting data from the user using the ''input()'' function | ::* Getting data from the user using the ''input()'' function | ||
− | ::* | + | ::* Using ''eval()'' for numbers obrained from the keyboard |
− | ::* Using the on-line | + | ::* Using the on-line [https://docs.python.org/3/ Python documentation] |
− | * '''Wednesday | + | ::* [[Media:CSC111_2018_Week2.pdf | Slides ]] |
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | * '''Wednesday''': Snow day! | ||
+ | [[Image:CalvinSnowDay.gif|center|500px]] | ||
+ | * '''Friday''' | ||
+ | ::* A word from Faith | ||
+ | ::* Understanding eval( input() ) | ||
+ | ::* Exercise 1 | ||
+ | ::* Exercise 2 | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[Media:CSC111_2018_Week2.pdf | Slides ]] | ||
| | | | ||
− | * | + | * [[CSC111 Lab 2 2018| Lab 2]] |
− | * | + | * [[CSC111 Homework 2 2018 | Homework 2]] |
| | | | ||
* Read Chapter 2 in Zelle. | * Read Chapter 2 in Zelle. | ||
Line 134: | Line 149: | ||
|} | |} | ||
<br /> | <br /> | ||
− | ::{| class="mw-collapsible" style="width:100%" border="1" | + | ::{| class="mw-collapsible " style="width:100%" border="1" |
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
|width="60%"| '''Topics''': Arithmetic operators, math functions, main(). | |width="60%"| '''Topics''': Arithmetic operators, math functions, main(). | ||
Line 141: | Line 156: | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday/Wednesday | + | * '''Monday''' |
− | + | :* 4 minutes from Grier's video: When computers were human. Start at time=28m12s. | |
+ | <br /> | ||
+ | <videoflash>YwqltwvPnkw</videoflash> | ||
+ | <br /> | ||
+ | [[Image:WomenCalculatingWWII.jpg|right|150px]] | ||
+ | ::* Operators: * / + - ** // % abs() | ||
+ | ::* The <tt>type()</tt> function | ||
+ | ::* Writing a cash-machine[[CSC111 Teller Machine Program | program]] | ||
+ | ::* Formatting numbers (see Section 5.8.2 in Zelle), and [[CSC111 Formatting String Example | example program]] | ||
+ | * '''Wednesday''' | ||
+ | ::* Formatting strings, ints and floats | ||
+ | ::* Using a main() function | ||
+ | ::* Accumulating results | ||
+ | ::* [[CSC111_Programs_Created_in_Class_2018 | Programs created in class]] | ||
+ | * '''Friday''' | ||
+ | ::* Logistics | ||
+ | ::* Accumulating Results | ||
+ | ::* What are bits? | ||
+ | ::* [[Media:CSC111_2018_Week3.pdf | Slides ]] | ||
| | | | ||
− | * | + | * [[CSC111_Lab_3_2018 | Lab 3]] |
+ | * [[CSC111_Homework_3_2018 | Homework 3]] | ||
| | | | ||
* Read Chapter 3 in Zelle. | * Read Chapter 3 in Zelle. | ||
Line 164: | Line 198: | ||
::{| class="mw-collapsible " style="width:100%" border="1" | ::{| class="mw-collapsible " style="width:100%" border="1" | ||
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
− | |width="60%"| '''Topics''': | + | |width="60%"| '''Topics''': Strings, Lists, and Files |
|width="15%"| '''Lab/Hw''' | |width="15%"| '''Lab/Hw''' | ||
|width="25%"| '''Reading''' | |width="25%"| '''Reading''' | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday/ | + | * '''Monday''' |
+ | ::* Strings, indexing | ||
+ | ::* positive and negative indexes | ||
+ | ::* lists, indexing lists | ||
+ | ::* string sections | ||
+ | ::* Concept of mutability and immutability | ||
+ | * '''Wednesday''' | ||
+ | ::* We have class on Wednesday, but the afternoon labs are cancelled | ||
+ | ::* [[Midterm Prep 2018| Typical midterm exam questions]] | ||
+ | ::* slicing lists and strings | ||
+ | ::* the concepts of mutable and immutable lists/strings | ||
+ | ::* strings as objects | ||
+ | ::* [https://docs.python.org/3/library/stdtypes.html?highlight=upper#string-methods String methods on Python.org] | ||
+ | ::* [[media:CSC111_2018_Week4.pdf | slides]] | ||
+ | * '''Friday''' | ||
+ | ::* String methods | ||
+ | ::* [https://docs.python.org/3/library/stdtypes.html?highlight=upper#string-methods String methods on Python.org] | ||
+ | ::* Working with text files | ||
+ | ::* [[media:CSC111_2018_Week4.pdf | slides]] | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
| | | | ||
* <font color="magenta">No Labs this week (Rally Day)</font> | * <font color="magenta">No Labs this week (Rally Day)</font> | ||
+ | * [[CSC111_Prep-Lab_4_2018| ''Optional'' Homework Prep]] | ||
+ | * [[CSC111_Homework_4_2018| Homework 4]] | ||
| | | | ||
− | * Read Chapter | + | * Read Chapter 5 in Zelle |
|} | |} | ||
Line 195: | Line 250: | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday | + | * [[Image:DaveMinion.png|right|100px]] '''Monday''' |
+ | ::* [[CreateTextFile.py | CreateTextFile.py]]: a program to create simple text files | ||
+ | ::* Functions & minions | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[media:CSC111_2018_Week5.pdf | slides]] | ||
+ | |||
+ | * '''Wednesday''' | ||
+ | ::* Review. | ||
+ | ::* A note about complex 1-liners versus multi-line statements: use whatever feels comfortable! | ||
+ | ::* Functions returning values | ||
+ | ::* Examples, and exercises | ||
+ | * '''Friday''' | ||
+ | ::* Function Boot Camp! | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[media:CSC111_2018_Week5.pdf | slides]] | ||
| | | | ||
− | * | + | * [[CSC111_Lab_5_2018 | Lab 5 ]] |
+ | * [[CSC111_Homework_5_2018 | Homework 5]], due the Thursday after spring break. | ||
| | | | ||
− | * Chapter 6 | + | * Chapter 6: Defining Functions |
|} | |} | ||
Line 214: | Line 284: | ||
|} | |} | ||
<br /> | <br /> | ||
− | ::{| class="mw-collapsible " style="width:100%" border="1" | + | ::{| class="mw-collapsible" style="width:100%" border="1" |
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
|width="60%"| '''Topics''': | |width="60%"| '''Topics''': | ||
Line 222: | Line 292: | ||
| | | | ||
* '''Monday''' | * '''Monday''' | ||
− | * '''Wednesday''': <font color="magenta">Midterm Exam</font> | + | ::* [[CSC111_Mid-Semester_Review_2018 |Review]] |
+ | :::* <font color="green">"...{x:y}..."</font>.format( ) | ||
+ | :::* indexing in a list | ||
+ | :::* how range() works | ||
+ | :::* functions receiving parameters, & returning values | ||
+ | * '''Wednesday''': <font color="magenta">Midterm Exam</font>, in class, timed, on Moodle, closed notes, closed books, closed Idle. | ||
* '''Friday''' | * '''Friday''' | ||
+ | ::* The concept of a Python library | ||
+ | ::* Comparing Python to Java | ||
+ | ::* Understanding the [http://eightqueen.becher-sundstroem.de/ N-Queens problem] | ||
+ | ::* [[NQueens.py | Solving the N-Queens problem in Python]] | ||
+ | ::* [[N-Queens_Problem_in_Java | Solving the N-Queens problem in Java]] | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[CSC111_And_now,_something_completely_different|And now, for something completely different...]] | ||
+ | ::* [[media:CSC111_2018_Week6.pdf | slides]] | ||
| | | | ||
− | * | + | * [[CSC111_Lab_6_2018| Lab 6]] |
+ | * No new homework. Homework 5 due after the break. | ||
| | | | ||
− | * | + | * No new reading assignment this week. |
|} | |} | ||
<br /><br /> | <br /><br /> | ||
<tanbox> | <tanbox> | ||
Spring Break | Spring Break | ||
+ | <!--center>[[File:animatedBeach.gif]]</center--> | ||
+ | |||
</tanbox> | </tanbox> | ||
<br /><br /> | <br /><br /> | ||
Line 246: | Line 332: | ||
::{| class="mw-collapsible " style="width:100%" border="1" | ::{| class="mw-collapsible " style="width:100%" border="1" | ||
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
− | |width="60%"| '''Topics''': Processing Files | + | |width="60%"| '''Topics''': Processing Files, Graphics, If Statements |
|width="15%"| '''Lab/Hw''' | |width="15%"| '''Lab/Hw''' | ||
|width="25%"| '''Reading''' | |width="25%"| '''Reading''' | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday | + | * '''Monday |
+ | ::* Back to reading files | ||
+ | ::* Writing text files | ||
+ | ::* Graphics | ||
+ | ::* If statements. Relational operators | ||
+ | * '''Wednesday''' | ||
+ | ::* More graphics, with points, rectangles, circles, text | ||
+ | ::* Basics of animation | ||
+ | ::* Testing for conditions: the IF statement | ||
+ | * '''Friday''' | ||
+ | ::* The If statements (Chapter 7) | ||
+ | ::* Examples | ||
+ | ::* [[CSC111_Exercises_with_If_Statements_(Python_3)| Exercises with If statements]] | ||
+ | ::* Rock, Paper, Scissors | ||
+ | ::* [[media:CSC111_2018_Week7.pdf | slides]] | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
| | | | ||
− | * | + | * [[CSC111_Lab_7_2018| Lab 7]] |
+ | * [[CSC111_Homework_6_2018| Homework 6 (due 3/30)]] | ||
| | | | ||
− | * Chapter 7 in Zelle | + | * Graphics are covered in Chapter 4 |
+ | * If statements are covered in Chapter 7 in Zelle | ||
|} | |} | ||
Line 272: | Line 375: | ||
::{| class="mw-collapsible " style="width:100%" border="1" | ::{| class="mw-collapsible " style="width:100%" border="1" | ||
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
− | |width="60%"| '''Topics''': | + | |width="60%"| '''Topics''': If-Statements, Eliza |
|width="15%"| '''Lab/Hw''' | |width="15%"| '''Lab/Hw''' | ||
|width="25%"| '''Reading''' | |width="25%"| '''Reading''' | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday | + | * '''Monday''' |
+ | ::* Boolean Operators (Chapter 8, Section 4) | ||
+ | ::* Organization of Graphic Program | ||
+ | ::* Dealing with Obstacles | ||
+ | * '''Wednesday''' | ||
+ | ::* Eliza | ||
+ | ::* Indefinite loops: while loops | ||
+ | * '''Friday''' | ||
+ | ::* Indefinite Loops (Chapter 8) | ||
+ | :::* Review for-loops | ||
+ | :::* Nested for-loops | ||
+ | :::* Break & Continue | ||
+ | ::* [[media:CSC111_2018_Week8.pdf | slides]] | ||
+ | ::* [[CSC111_Programs_Created_in_Class_2018| Programs created in class]] | ||
| | | | ||
− | * | + | * [[CSC111_Lab_8_2018| Lab 8]] |
+ | * [[CSC111_Homework_7_2018| Homework 7]] | ||
| | | | ||
− | * Indefinite | + | * Indefinite Loops and boolean operators are covered in Chapter 8. |
|} | |} | ||
Line 303: | Line 420: | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday | + | * '''Monday''' |
+ | ::* Exceptions | ||
+ | ::* Programming with Objects and Classes | ||
+ | * '''Wednesday''' | ||
+ | ::* Continue with classes | ||
+ | :::* Min/Max of tuples | ||
+ | :::* Die class | ||
+ | :::* Cat class | ||
+ | :::* Global vs local | ||
+ | * '''Friday''' | ||
+ | ::* Creating a graphic class for a car | ||
+ | ::* [[media:CSC111_2018_Week9.pdf | slides]] | ||
+ | ::* [[CSC111_Programs_Created_in_Class_2018| Programs created in class]] | ||
+ | |||
| | | | ||
− | * | + | * [[CSC111_Lab_9_2018 | Lab 9]] |
+ | * [[CSC111_Homework_8_2018 | Homework 8]] | ||
| | | | ||
* Section 7.4 in Zelle, on Exceptions | * Section 7.4 in Zelle, on Exceptions | ||
Line 330: | Line 461: | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday/ | + | [[File:CatGlasses.gif|right|150px]][[File:flowersSmith.gif|right|150px]][[File:catHat.gif|right|150px]] |
+ | * '''Monday''' | ||
+ | ::* Image Processing | ||
+ | ::* Nested for-loops for image processing | ||
+ | ::* Displaying gif images | ||
+ | ::* Sweep through an image: vertical sweep, horizontal sweep | ||
+ | ::* Changing the color of a pixel | ||
+ | ::* Changing the color of all the pixels of an image | ||
+ | ::* Grey scales | ||
+ | ::* Saturation | ||
+ | * '''Wednesday''' | ||
+ | [[Image:piece.gif|right]][[Image:piece2.gif|right]] | ||
+ | ::* More Image transformations | ||
+ | :::* Copy an image | ||
+ | :::* Mirror an image | ||
+ | ::* Displaying a chessboard | ||
+ | ::* Setting up a game of checkers | ||
+ | <center><videoflash>KpMPHhzZzH4</videoflash></center> | ||
+ | * '''Friday''' | ||
+ | ::* Continue with the game of checkers | ||
+ | :::* Using objects made of 2 circles | ||
+ | :::* Using a gif image for a piece | ||
+ | :::* Moving checkers on the board | ||
+ | :::* Removing checkers from the board | ||
+ | :::* Adding a Quit button to the game | ||
+ | ::* Lists of Lists (Chapter 11) | ||
+ | :::* Sorting | ||
+ | :::* Reversing | ||
+ | :::* Removing duplicates | ||
+ | ::* Sorting lists of objects (lists of cats) | ||
+ | ::* Filtering data | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[media:CSC111_2018_Week10.pdf | slides]] | ||
| | | | ||
− | * | + | * [[CSC111_Lab_10_2018 | Lab 10]] |
+ | * [[CSC111_Homework_9_2018 | Homework 9]] | ||
| | | | ||
− | * | + | * Chapter 11, Designing with Lists and Classes |
|} | |} | ||
Line 351: | Line 515: | ||
::{| class="mw-collapsible " style="width:100%" border="1" | ::{| class="mw-collapsible " style="width:100%" border="1" | ||
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
− | |width="60%"| '''Topics''': | + | |width="60%"| '''Topics''': Class inheritance |
|width="15%"| '''Lab/Hw''' | |width="15%"| '''Lab/Hw''' | ||
|width="25%"| '''Reading''' | |width="25%"| '''Reading''' | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday/ | + | * '''Monday''' |
+ | ::* Lists of Lists | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[media:CSC111_2018_Week11.pdf | slides]] | ||
+ | * '''Wednesday''' | ||
+ | ::* Class Inheritance | ||
+ | ::* Example 1: Super class = GenericCar, derived classes = Taxi, CarWithTop | ||
+ | ;:* Example 2: Super class = Rectangle, derived class = RectLabel | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[media:CSC111_2018_Week11.pdf | slides]] | ||
+ | * '''Friday''' | ||
+ | [[File:JoeOrourkeQuantumComputing111.png|150px|right|link=https://www.facebook.com/264041891883/photos/a.267301956883.154614.264041891883/10155418103811884/?type=3&theater]] | ||
+ | ::* Guest lecture by Prof. Joseph O'Rourke on ''Quantum Computing'' | ||
+ | |||
| | | | ||
− | * | + | * [[CSC111_Lab_11_2018 | Lab 11]] |
+ | * [[CSC111_Homework_10_2018 | Homework 10]] | ||
| | | | ||
− | * | + | * Chapter 11 on Lists of lists |
+ | * Chapter 12 in Zelle, on Objects and Inheritance | ||
|} | |} | ||
Line 377: | Line 556: | ||
::{| class="mw-collapsible " style="width:100%" border="1" | ::{| class="mw-collapsible " style="width:100%" border="1" | ||
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
− | |width="60%"| '''Topics''': | + | |width="60%"| '''Topics''': Polymorphism, Dictionaries, and Recursion |
|width="15%"| '''Lab/Hw''' | |width="15%"| '''Lab/Hw''' | ||
|width="25%"| '''Reading''' | |width="25%"| '''Reading''' | ||
|-valign="top" | |-valign="top" | ||
| | | | ||
− | * '''Monday | + | [[File:WarppingPaper11.png|150px|right|link=http://www.science.smith.edu/dftwiki/index.php/Nice_Wrapping_Paper...]] |
+ | * '''Monday''' | ||
+ | ::* [[Nice_Wrapping_Paper... | Wrapping paper...]] | ||
+ | ::* Polymorphism | ||
+ | ::* Dictionaries | ||
+ | ::* Recursion | ||
+ | * '''Wednesday''' | ||
+ | ::* Dictionaries (cont'd) | ||
+ | ::* Recursion | ||
+ | * '''Friday''' | ||
+ | ::* More recursion! | ||
+ | ::* A look at how recursion uses memory | ||
+ | ::* Back to minions and processing lists of bananas | ||
+ | ::* [[CSC111 Programs Created in Class 2018| Programs created in class]] | ||
+ | ::* [[media:CSC111_2018_Week12.pdf | slides]] | ||
| | | | ||
− | * | + | * [[CSC111_Lab_12_2018 | Lab 12]] |
+ | * [[CSC111_Homework_11_2018 | Homework 11]] | ||
| | | | ||
* Zelle, Section 11.6 on Dictionaries. | * Zelle, Section 11.6 on Dictionaries. | ||
+ | * Zelle, Chapter 13 on Recursion | ||
|} | |} | ||
Line 403: | Line 598: | ||
::{| class="mw-collapsible" style="width:100%" border="1" | ::{| class="mw-collapsible" style="width:100%" border="1" | ||
|- style="background:#dddddd;" | |- style="background:#dddddd;" | ||
− | |width="60%"| '''Topics''': | + | |width="60%"| '''Topics''': Advanced Topics: recursion |
|width="15%"| '''Lab/Hw''' | |width="15%"| '''Lab/Hw''' | ||
|width="25%"| '''Reading''' | |width="25%"| '''Reading''' | ||
Line 409: | Line 604: | ||
| | | | ||
* '''Monday''' | * '''Monday''' | ||
− | * '''Wednesday''': <font color="magenta">Final | + | [[File:maze.png|right|150px]] |
+ | ::* Visiting a maze | ||
+ | ::* Fractal trees | ||
+ | ::* [[CSC111_Programs_Created_in_Class_2018 | Programs created in class]] | ||
+ | * '''Wednesday''': <font color="magenta">Final 1-week take-home exam</font> | ||
+ | ::* Towers of Hanoi | ||
+ | ::* [[CSC111_Programs_Created_in_Class_2018 | Programs created in class]] | ||
+ | ::* [[CSC111_Final_Exam_2018|Final Exam]] | ||
+ | ::* [[media:CSC111_2018_Week13.pdf | slides]] | ||
| | | | ||
− | * | + | * <font color="magenta">No labs this week</font> |
+ | * [[CSC111_Final_Exam_2018|Final Exam]] | ||
| | | | ||
− | * Chapter | + | * Chapter 13 on Recursion |
− | |||
|} | |} | ||
Latest revision as of 09:10, 3 May 2018
D. Thiebaut (talk) 12:58, 16 January 2018 (EST)
Week 0 Jan 26 |
Topics: Overview of CSC111 Lab/Hw Reading - Friday
- Introduction
- Syllabus
- Expectations
- Pair Programming
- A feel for coding in Python
- Some programs to play with
- Slides
- No homework assignment this week
- For next week, Read Chapter 1 in Zelle (textbook)
- Read the article on Pair Programming
Week 1 Jan 29 |
Topics: Introduction, Python, Idle, Piazza, Moodle submission Lab/Hw Reading - Monday
- We are getting the "feel" for Python programming...
- More examples of Python programs
- Preparation for Lab #1: Install Idle & Python on your laptop
- Some programs to play with in Idle
- Wednesday
- We continue with our exploration of Python. Getting the intuitive aspect of programming.
- Introduction to Lab 1
- Assignments
- Variables. Rules, camelCase
- Programs created in class
- slides
- Friday
- The programming process
- Variables and literals
- Memory: what does it look like?
- Overloaded operators
- Using the shell for quick testing
- Definite Loops (for ... in sequence: )
- Python documentation
- The range() function
- slides
- Read Chapter 1 in Zelle (textbook)
- Read the article on Pair Programming
Week 2 Feb 5 |
Topics: Chapter 2: variables, definite loops, input, the range function Lab/Hw Reading - Monday
- Counted loops and the range() expression
- Getting data from the user using the input() function
- Using eval() for numbers obrained from the keyboard
- Using the on-line Python documentation
- Slides
- Programs created in class
- Wednesday: Snow day!
- Friday
- A word from Faith
- Understanding eval( input() )
- Exercise 1
- Exercise 2
- Programs created in class
- Slides
- Read Chapter 2 in Zelle.
Week 3 Feb. 12 |
Topics: Arithmetic operators, math functions, main(). Lab/Hw Reading - Monday
- 4 minutes from Grier's video: When computers were human. Start at time=28m12s.
- Operators: * / + - ** // % abs()
- The type() function
- Writing a cash-machine program
- Formatting numbers (see Section 5.8.2 in Zelle), and example program
- Wednesday
- Formatting strings, ints and floats
- Using a main() function
- Accumulating results
- Programs created in class
- Friday
- Logistics
- Accumulating Results
- What are bits?
- Slides
- Read Chapter 3 in Zelle.
Week 4 Feb. 19 |
Topics: Strings, Lists, and Files Lab/Hw Reading - Monday
- Strings, indexing
- positive and negative indexes
- lists, indexing lists
- string sections
- Concept of mutability and immutability
- Wednesday
- We have class on Wednesday, but the afternoon labs are cancelled
- Typical midterm exam questions
- slicing lists and strings
- the concepts of mutable and immutable lists/strings
- strings as objects
- String methods on Python.org
- slides
- Friday
- String methods
- String methods on Python.org
- Working with text files
- slides
- Programs created in class
- No Labs this week (Rally Day)
- Optional Homework Prep
- Homework 4
- Read Chapter 5 in Zelle
Week 5 Feb 26 |
Topics: Functions, Files. Lab/Hw Reading - Monday
- CreateTextFile.py: a program to create simple text files
- Functions & minions
- Programs created in class
- slides
- Wednesday
- Review.
- A note about complex 1-liners versus multi-line statements: use whatever feels comfortable!
- Functions returning values
- Examples, and exercises
- Friday
- Function Boot Camp!
- Programs created in class
- slides
- Lab 5
- Homework 5, due the Thursday after spring break.
- Chapter 6: Defining Functions
Week 6 March 5 |
Topics: Lab/Hw Reading - Monday
-
- "...{x:y}...".format( )
- indexing in a list
- how range() works
- functions receiving parameters, & returning values
-
- Wednesday: Midterm Exam, in class, timed, on Moodle, closed notes, closed books, closed Idle.
- Friday
- The concept of a Python library
- Comparing Python to Java
- Understanding the N-Queens problem
- Solving the N-Queens problem in Python
- Solving the N-Queens problem in Java
- Programs created in class
- And now, for something completely different...
- slides
- Lab 6
- No new homework. Homework 5 due after the break.
- No new reading assignment this week.
Spring Break
Week 7 March 19 |
Topics: Processing Files, Graphics, If Statements Lab/Hw Reading - Monday
- Back to reading files
- Writing text files
- Graphics
- If statements. Relational operators
- Wednesday
- More graphics, with points, rectangles, circles, text
- Basics of animation
- Testing for conditions: the IF statement
- Friday
- The If statements (Chapter 7)
- Examples
- Exercises with If statements
- Rock, Paper, Scissors
- slides
- Programs created in class
- Graphics are covered in Chapter 4
- If statements are covered in Chapter 7 in Zelle
Week 8 March 26 |
Topics: If-Statements, Eliza Lab/Hw Reading - Monday
- Boolean Operators (Chapter 8, Section 4)
- Organization of Graphic Program
- Dealing with Obstacles
- Wednesday
- Eliza
- Indefinite loops: while loops
- Friday
- Indefinite Loops (Chapter 8)
- Review for-loops
- Nested for-loops
- Break & Continue
- Indefinite Loops and boolean operators are covered in Chapter 8.
Week 9 Apr. 2 |
Topics: Exceptions, Classes, and Objects Lab/Hw Reading - Monday
- Exceptions
- Programming with Objects and Classes
- Wednesday
- Continue with classes
- Min/Max of tuples
- Die class
- Cat class
- Global vs local
- Friday
- Creating a graphic class for a car
- slides
- Programs created in class
- Section 7.4 in Zelle, on Exceptions
- Chapter 10: Defining Classes
Week 10 April 9 |
Topics: Image Processing Lab/Hw Reading - Monday
- Image Processing
- Nested for-loops for image processing
- Displaying gif images
- Sweep through an image: vertical sweep, horizontal sweep
- Changing the color of a pixel
- Changing the color of all the pixels of an image
- Grey scales
- Saturation
- Wednesday
- More Image transformations
- Copy an image
- Mirror an image
- Displaying a chessboard
- Setting up a game of checkers
- Friday
- Continue with the game of checkers
- Using objects made of 2 circles
- Using a gif image for a piece
- Moving checkers on the board
- Removing checkers from the board
- Adding a Quit button to the game
- Lists of Lists (Chapter 11)
- Sorting
- Reversing
- Removing duplicates
- Sorting lists of objects (lists of cats)
- Filtering data
- Programs created in class
- slides
- Chapter 11, Designing with Lists and Classes
Week 11 Apr 16 |
Topics: Class inheritance Lab/Hw Reading - Monday
- Lists of Lists
- Programs created in class
- slides
- Wednesday
- Class Inheritance
- Example 1: Super class = GenericCar, derived classes = Taxi, CarWithTop
- Example 2: Super class = Rectangle, derived class = RectLabel
- Programs created in class
- slides
- Friday
- Guest lecture by Prof. Joseph O'Rourke on Quantum Computing
- Chapter 11 on Lists of lists
- Chapter 12 in Zelle, on Objects and Inheritance
Week 12 Apr 23 |
Topics: Polymorphism, Dictionaries, and Recursion Lab/Hw Reading - Monday
- Wrapping paper...
- Polymorphism
- Dictionaries
- Recursion
- Wednesday
- Dictionaries (cont'd)
- Recursion
- Friday
- More recursion!
- A look at how recursion uses memory
- Back to minions and processing lists of bananas
- Programs created in class
- slides
- Zelle, Section 11.6 on Dictionaries.
- Zelle, Chapter 13 on Recursion
Week 13 Apr 30 |
Topics: Advanced Topics: recursion Lab/Hw Reading - Monday
- Visiting a maze
- Fractal trees
- Programs created in class
- Wednesday: Final 1-week take-home exam
- Towers of Hanoi
- Programs created in class
- Final Exam
- slides
- No labs this week
- Final Exam
- Chapter 13 on Recursion
Links and Resources
Graphics
- Zelle's graphic library can be found here
- A page with color names supported by the graphics library.
On-Line Python books
- disocovermagazine.com blog. Check out the answers posted by many readers. They contain some interesting links that you may find useful!
Python keywords
- The list of all the reserved words of the Python language
- and del for is raise assert elif from lambda return break else global not try class except if or while continue exec import pass yield def finally in print.
Python Programs in Textbook
- All the programs of Zelle's Python textbook
Misc
- When you work in pairs during the labs, or on homework assignments, you need to follow the protocol for 'pair programming' as discussed in this article.
Fun Programming Ideas to Explore on Your Own
|
TED: In 2007, Paul Rothemund gave TED a short summary of his specialty, DNA folding. Now he lays out in clear, abundant detail the immense promise of this field -- to create tiny machines that assemble themselves. |