Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.4 KB

0-outline.md

File metadata and controls

42 lines (32 loc) · 1.4 KB

CME 211 Lecture 2: Conditionals, Lists, Loops, and File IO

Reading

Relevant chapters in Learning Python by Mark Lutz are:

  • Chapter 4 (Introducing Python Object Types) has a summary of the object types
  • Chapter 5: Numeric Types
  • Chapter 7: String Fundamentals
  • Chapter 8: Lists and Dictionaries (you can ignore Dictionaries for now)
  • Chapter 9: Tuples, Files, and Everything Else
  • Chapter 11: Assignments, Expressions, and Prints
  • Chapter 12: if Tests and Syntax Rules
  • Chapter 13: while and for Loops

Outline

We have a lot to cover in this lecture:

  • Python data types
  • Logical Operations
  • if statements
  • Python lists
  • Looping
  • File input output

Big picture

To complete a task in any programming language, the software developer must consider the following:

  • Data and it's representation
  • Operations: modifying or computing things from data
  • Flow of control: selecting which operations to run

With the combination of these things, we can write programs that tell a computer what to do. A computer program is a form of imperative or procedural knowledge. Most programming today is done in this style. This is different from declarative knowledge. An example of this difference from mathematics is a system of equations vs. an algorithm to find a solution to the system of equations. The algorithm tells a specific procedure so that we can find the quantity we are interested in.