MIT Python Programming #2

Lecture 2: Operators and operands; statements; branching, conditionals, and iteration Instructors

 

Massachusetts Institute of Technology: Introduction to Computer Science and Programming

Introduction to Computer Science & Programming Class Notes

Primitive Data – 3 Types (Numbers, Strings, Booleans).

No matter how complex a data structure you create, fundementally at there
basis you will find some combination of NUMBERS, STRINGS, and BOOLEANS.

Associated with every primitive value is a type.

Strings: Strings
Numbers: Integers, Floats
Booleans: True, False

Operands and Operators are combined in ...

Read more →
0

MIT Python Programming #1

Lesson 1: Goals of the course; what is computation; introduction to data types, operators, and variables

 

Massachusetts Institute of Technology: Introduction to Computer Science and Programming

Instructors: Prof. Eric Grimson, Prof. John Guttag

View the complete course at: http://ocw.mit.edu/6-00F08

License: Creative Commons BY-NC-SA

More information at http://ocw.mit.edu/terms

More courses at http://ocw.mit.edu

Introduction to Computer Science & Programming Notes

Computational Thinking (Write Code)

Understand Code (Read Code)

Map Problems Into Computation (Analysis & Design)

What is Computation? To better answer this question let me first ask you:
Read more →

0

MIT Python Programming #7

Lesson 7: Lists and mutability, dictionaries, pseudocode, introduction to efficiency

Massachusetts Institute of Technology (Open Course Ware): Introduction to Computer Science and Programming

View the complete course at: http://ocw.mit.edu/6-00F08

Introduction to Computer Science & Programming Class Notes

Lists and mutability, dictionaries, pseudo code, introduction
to efficiency

Lesson 6 we discussed lists. Lists are mutable.

Ivys [ 1 ] = -15    The object 1 within the
Ivys list is now given a value of -15

Ivys = [ 'Yale', '-1', 'Princeton' ...

Read more →
0

MIT Python Programming #4

Decomposition and abstraction through functions; introduction to recursion

Massachusetts Institute of Technology: Introduction to Computer Science and Programming

Lecture 4: Decomposition and abstraction through functions; introduction to recursion

Instructors: Prof. Eric Grimson, Prof. John Guttag

View the complete course at: http://ocw.mit.edu/6-00F08

Introduction to Computer Science & Programming Class Notes

In the previous 3 lessons we learned the following in our language:
– Assignment
– Conditionals
– Input/Output
– Looping Constructs (For, While)

Touring Complete: The above fundamentals are enough to ...

Read more →
0

MIT Python Programming #5

Lesson 5: Floating point numbers, successive refinement, finding roots

Massachusetts Institute of Technology (OpenCoarseWare): Introduction to Computer Science and Programming

Lecture 5: Floating point numbers, successive refinement, finding roots

Instructors: Prof. Eric Grimson, Prof. John Guttag

View the complete course at: http://ocw.mit.edu/6-00F08

Introduction to Computer Science & Programming Class Notes

Floating point numbers, successive refinement, finding roots

Python has 2 types of numbers:
int (integers – whole numbers)
Arbitrary precision (Long Integer)

The following code displays arbitrary precision:
a = 2**1000
Type ...

Read more →
0

MIT Python Programming #3

Lesson 3: Common code patterns: iterative programs

Massachusetts Institute of Technology: Introduction to Computer Science and Programming

View the complete course at: http://ocw.mit.edu/6-00F08

Introduction to Computer Science & Programming Class Notes

Data Operations Commands
Numbers + – * / Assignment (Bind a name to a value)
Strings   input/output (Print)
Booleans and, or Conditionals (Branches)
    Loop Mechanisms (While)

Good Programming Style: Use comments. Type discipline (check
types of operands to properly apply correct operations). Descriptive use of good
variable names as a way of documenting code. Testing all possible branches
Read more →

0

MIT Python Programming #6

Lesson 6: Bisection methods, Newton/Raphson, introduction to lists

Massachusetts Institute of Technology (OpenCoarseWare): Introduction to Computer Science and Programming

View the complete course at: http://ocw.mit.edu/6-00F08

Introduction to Computer Science & Programming Class Notes

Bisection methods, Newton/Raphson, introduction to lists

Speed of Convergence
sqrt(x)
f(guess = guess2 -x
f(guess) = 0

As discussed in lesson 5, the best method to find the answer for
differentiable functions is the Netwon/Ralphson Method.

guess i = guess i – f (guess i) / 2 ...

Read more →
0
Page 1 of 2 12