Computer Science for Beginners
Lesson 3: Python Lab Part 1
Lesson Date: 2024-07-14
Topics
- Primarily lab-only, no lecture.
- Students should bring their laptops and expect to write code (or if they haven’t yet, get help with setting up their IDEs to write some code), or pair up with other students and write code together.
- Most of programming is solving complex word problems
- Being a good programmer has helped me to become a better theologoian and student of the Bible, and vice versa.
while
loops in the Bible that convey the responsibility, joy, and privilege of worshiping God:
- Work through Exercism Python exercises together as a class.
- Hello World
- Guido’s Gorgeous Lasgana
- Everything is an object in Python
- Objects have properties and methods
dir(obj)
can be called with an object to see what properties and methods are available on the object
- Objects are instances of classes
- *objects8
- Ghost Gobble Arcade Game
- Boolean logic / Boolean algebra
- Named after George Boole
- Basic operations: conjuction (and), disjunction (or), negation (not)
- Truth tables can be useful in helping to visualize relationships between inputs and outputs
- Negation Equivalencies:
not(A and B) == not(A) or not(B)
not(A or B) == not(A) and not(B)
Reading / Notes
- Biography of a famous computer scientist: Grace Hopper
- Famous quote: It’s easier to ask forgiveness than it is to get permission.
- Variant: “That brings me to the most important piece of advice that I can give to all of you: if you’ve got a good idea, and it’s a contribution, I want you to go ahead and DO IT. It is much easier to apologize than it is to get permission.”
Homework
- Complete as many Exercism exercises as possible, with a minimum of completing Python exercise #2, Guido’s Gorgeous Lasagna