Lecture 1 | Next Lecture |
Lecture 1, Tue 08/08
Orientation to the course
Abstractions and Algorithms
(a review of part of the syllabus)
Abstractions and notation: three, index.
An index takes in as input a topic, and gives us back a page number.
A Point-of-Sale bar code scanner at a store checkout maps a barcode, to info about the item (description and price).
A FUNCTION in general, takes in an input (or a set of inputs) and gives us back a value.
In math, for example,
f(x) = x2
Learning Something New
-
Basketball: drills vs. playing the game
-
Swimming, Painting, Guitar
-
Fixed vs. Growth Mindset
Python REPL (Read Eval Print Loop)
Also called the Python Shell Prompt
login as: pconrad
pconrad@csil-01.cs.ucsb.edu's password:
Last login: Mon Aug 7 15:29:19 2017 from 98.188.150.204
-bash-4.3$
-bash-4.3$ python3
Python 3.4.3 (default, Aug 9 2016, 15:36:17)
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2 + 3
5
>>> 2 + 7 *4
30
>>> 2 ** 3
8
>>> 2 ** 3 ** 2
512
>>> 2 * 3 * 4
24
>>> (2 * 3) * 4
24
>>> 2 * (3 * 4)
24
>>> (2 ** 3) ** 2
64
>>> 2 ** (3 ** 2)
512
>>>
Note that **
is right associative, not left associative.
The textbook and the homework
- Look over H00, H01, H02, and show the calendar.
IDLE and Python
The syllabus is here: https://ucsb-cs8-m17.github.io/info/syllabus/