Chap01 1 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

9/23/2011

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

The Computing Machine


What is a computer program? A detailed, step-by-step set of instructions telling a computer what to do (like a recipe). If we change the program, the computer performs a different set of actions or a different task. Programs are always executed exactly as written.
Never a doubt, a question, or cant-do.

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

The highs and lows of programming languages ...


High-Level Language (HLL) Machine Language (lowest level)

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

Types of Programming Languages

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

The History of Python


Python is a high-level programming language. The language has an open, community-based development model managed by the Python Software Foundation (www.python.org). Python was conceived in the late 1980s by Guido van Rossum in the Netherlands. Python 2.0 was released on 16 October 2000. Python 3.0, a major, backwards-incompatible release, was released on 3 December 2008. Many of its major features have been backported to the backwardscompatible Python 2.6.

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

When you start Python, you will see something like:


Python 3.1.2 March 212010, 00:41:52) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>>

You might also like