Comp 112
Lecture 0
Course Introduction2018.01.25
Introduction to imperative programming, using the programming language Python.
Learn to write, read and reason about simple programs.
Use programming to solve interesting problems:
Is this course for you?
background
comfortable using computers
(running programs, opening/saving files, editing text)
little or no programming experience
intended plans
alternatives:
COMP 211
more rigorous/mathematical, more complex assignments/projects
QAC 155
Python programming for data management
(discussion)
(discussion)
(discussion)
A programming language is a formal language for representing and manipulating information and performing tasks.
An imperative programming language does this using sequences of instructions. (Do this, next do that…)
Interact with computers on your own terms.
Automate laborious tasks.
Bring your ideas to life.
Gain a mental force multiplier.
It’s fun!
Learn what – i.e. concepts (lecture, readings)
Learn how – i.e. skills (lab, homework)
Learning programming is a process,
to be successful, you need to invest time and attention.
High level of precision and detail required.
Unfamiliar syntax.
Syntax is the rules for expressing an idea in a particular language.
Example: English has rules for spelling, punctuation and grammar.
To be understood, we must express our thoughts according to the rules. (…sorta)
Extracting the idea from the representation is parsing.
Natural languages tend to be complex and flexible:
To die, to sleep; to sleep, perchance to dream; aye, there’s the rub, for in that sleep of death, what dreams may come, when we have shuffled off this mortal coil, must give us pause.
Formal languages are typically simple but rigid:
3 + 4 × 5
means
3 + (4 × 5)
or
Note: although “” and “” have the same value, they are not the same expression!
Named for Al-Khwārizmī, a 9th c. Persian mathematician, astronomer and cartographer.
must be clear and unambiguous
no ingenuity or creativity required
must handle every possible case
must eventually produce a result
3 + (4 × 5)
steps to
3 + 20
steps to
23
or
Python is:
In this course we will use the Python language version 3.
An open-source project (http://python.org)
An interpreter (python
, python3
)
A program editor (IDLE
)
Documentation (books, videos, reference manuals, etc.)
Community (mailing lists, blogs, conferences, etc.)
Download the book Think Python (2nd ed.) and read chapter 1 (8 pages).
Complete assignment 0.
Follow instructions to download and install Python3 for your computer (if you don’t already have it installed).