Chap01 1 PDF
Chap01 1 PDF
Chap01 1 PDF
Python Programming:
An Introduction to Computer Science
Chapter 1 Computers and Programs
EECS12 Description
Text book: Python Programming: An Introduction to Computer Science, 2nd edition (homepage at http://mcsp.wartburg.edu/zelle/python/) Author: John M. Zelle Publisher: Franklin Beedle & Associates (2010) Course web site: http://eee.uci.edu/11f/18040/ All information, discussions and project submissions are to be done using EEE.
9/23/2011
Course Workload
Lectures: MWF 10-11, Mandatory, 3 hours/week Discussion: Mandatory, 1 hour/week, for project discussion, programming skills, etc. Lab: 3 hours/week, TAs will be available for questions and programming help Mid-term exam I (20%): Oct 19, 10-10:50 Mid-term exam II (20%): Nov 14, 10-10:50 Final Exam (30%): Mon, Dec 5, 10:30-12:30 6 Homework assignments (30%)
You may need to spend a total of 8-10 hours/week for this class Professor/TA office hours have been posted
Class Rules
No laptop usage during lectures No food or drinks in lecture hall and lab All exams are closed-book, no electronic device
Bring your ID
No late homework !!
Submit your program early and multiple times Dont wait until the last minute/hour
Students are not allowed to work together when coding the programs.
Just like writing essays, it is ok to have discussions before coding, or ask for help on debugging.
9/23/2011
All computers have similar capabilities, with suitable programming, i.e. each computer can do the things any other computer can do (given the same configuration).
Program Power
Software (programs) runs on the hardware (the physical machine). The process of creating software is called programming (coding) . Why learn to program?
Create new capabilities to meet your needs Having an understanding of programming helps you have an understanding of the strengths and limitations of computers. Simulate real world situations without building the real thing
9/23/2011
Programming Languages
High-level computer languages
Designed to be used and understood by humans
Low-level language
Computer hardware can only understand a very low level language known as machine language
closest to natural language words, numbers, and math symbols not directly understood by hardware portable source code (hardware independent) Java, C, C++, COBOL, FORTRAN, BASIC, Lisp, Ada, etc.
least natural language for humans, most natural language for hardware just 0s and 1s directly understood by hardware not portable (hardware dependent)
9/23/2011
1.
Machine languages: everything inside a computer is made of numbers (including instructions and data)
Strings of numbers giving machine specific instructions Example:
+1300042774 +1400593419 +1200274027
2.
Assembly languages
English-like abbreviations representing elementary computer operations (translated via assemblers) Example:
LOAD ADD STORE BASEPAY OVERPAY GROSSPAY
High-level Languages
3. High-level languages
Codes similar to everyday English Use mathematical notations (translated via compilers) Most useful computer languages are HLL
C, C++, Java, C#, Python
Example:
grossPay = basePay + overTimePay
vs.
LOAD ADD STORE BASEPAY OVERPAY GROSSPAY
9/23/2011
Why Python
Python is often used as a browser language for web applications. Among the users of Python are YouTube and the original BitTorrent client. Large organizations that make use of Python include Google, Yahoo, CERN, NASA, and ITA. It is easy to learn and easy to use. It has a free interpreter and tool environment
9/23/2011
Installing Python
Go to www.python.org and visit the download page Get Python 3.2 for the type of computer you have