Introduction to Programming Peggy Batchelor.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Advertisements

Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
CS 110 Intro to Computer Science I Sami Rollins Fall 2006.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to Python Programming Outline 2.1 Introduction 2.2 First Program in Python: Printing.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Programming. Software is made by programmers Computers need all kinds of software, from operating systems to applications People learn how to tell the.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
PYTHON: LESSON 1 Catherine and Annie. WHAT IS PYTHON ANYWAY?  Python is a programming language.  But what’s a programming language?  It’s a language.
Computer Science 101 Introduction to Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Thanks to: Dr. John S. Mallozzi Department of Computer Science 1. Introduction 2. Overview of programming in Python.
CS 111 Introduction to Computing Introduction: Why study computer science at all?!? Developed by Mark Guzdial, Georgia Institute of Technology, 2003–2004;
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Chapter Introduction to Computers and Programming 1.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 2 Fundamentals of Programming Languages 4/5/09 Python Mini-Course: Day.
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Python
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Media Computing Instructor Byung Kim Olsen 231 Office hours – MWF 9:00-10:00 AM or by appointment.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
INLS 560 – P ROGRAMMING FOR I NFORMATION P ROFESSIONALS Instructor: Jason Carter.
Python From the book “Think Python”
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 1 Introduction.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Chapter 1: Introduction to Computer Science and Media Computation.
Chapter Three The UNIX Editors.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
You Need an Interpreter!. Closing the GAP Thus far, we’ve been struggling to speak to computers in “their” language, maybe its time we spoke to them in.
1 Software. 2 What is software ► Software is the term that we use for all the programs and data on a computer system. ► Two types of software ► Program.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.
CS1315 Introduction to Media Computation Introduction: Why study computer science at all?!?
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Software Development Languages and Environments. Computer Languages Just as there are many human languages, there are many computer programming languages.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Chapter 1: Introduction to Computer Science and Media Computation.
Development Environment
Topics Introduction Hardware and Software How Computers Store Data
Chapter 1: Introduction to Computer Science and Media Computation
Topics Introduction to Repetition Structures
CS1315 Introduction to Media Computation
Chapter 1: Introduction to Computer Science and Media Computation
CS1315 Introduction to Media Computation
Topics Introduction Hardware and Software How Computers Store Data
Topics Introduction Hardware and Software How Computers Store Data
Topics Designing a Program Input, Processing, and Output
CS 1111 Introduction to Programming Spring 2019
CSIS110 - Introduction to Computer Science
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Chapter 1: Programming Basics, Python History and Program Components
General Computer Science for Engineers CISC 106 Lecture 03
Introduction to Computer Science
CSIS110 - Introduction to Computer Science
Chapter 1: Introduction to Computer Science and Media Computation
Presentation transcript:

Introduction to Programming Peggy Batchelor

Defining terms A program is a description in a programming language of a process that achieves some result. An algorithm is a description of a process in a step-by-step manner. The same algorithm could be written in many languages.

What computers understand Computers are exceedingly stupid The only data they understand is 0’s and 1’s They can only do the most simple things with those 0’s and 1’s Move this value here Add, multiply, subtract, divide these values Compare these values, and if one is less than the other, go follow this step rather than that one. Done fast enough, those simple things can be amazing.

Programming Languages Different programming languages are different ways (encodings) that turn into (same/similar) commands for the computer

Python The programming language we will be using is called Python Python is a popular programing language, which is designed to be easy to read. Used by many companies. It’s used by companies like Google, Industrial Light & Magic, Pixar, Nextel, and others Also used to make application software flexible and expendable. For example, can be used to program GIMP or Blender

A word about Jython Jython is Python Python is a language implemented in C. Jython is the same language implemented in Java. Is the pizza different if a different company makes the flour? If so, not by much.

Key Concept: Encodings We can interpret the 0’s and 1’s in computer memory any way we want. We can treat them as numbers. We can encode information in those numbers Even the notion that the computer understands numbers is an interpretation We encode the voltages on wires as 0’s and 1’s, eight of these defining a byte Which we can, in turn, interpret as a decimal number

Computation for Communication All media are going digital Digital media are manipulated with software You are limited in your communication by what your software allows What if you want to say something that Microsoft or Adobe or Apple doesn’t let you say?

Programming is a communications skill If you want to say something that your tools don’t allow, program it yourself If you want to understand what your tools can or cannot do, you need to understand what the programs are doing If you care about preparing media for the Web, for marketing, for print, for broadcast… then it’s worth your while to understand how the media are and can be manipulated. Knowledge is Power, Knowing how media work is powerful and freeing

Knowing about programming is knowing about process Alan Perlis One of the founders of computer science Argued in 1961 that Computer Science should be part of a liberal education: Everyone should learn to program. Perhaps computing is more critical to a liberal education than Calculus Calculus is about rates, and that’s important to many. Computer science is about process, and that’s important to everyone. Automating process changes everything.

Programming is about Communicating Process A program is the most concise statement possible to communicate a process That’s why it’s important to scientists and others who want to specify how to do something understandably in as few words as possible

Key Words, Operators, and Syntax: an Overview Key words: predefined words used to write program in high-level language Each key word has specific meaning Operators: perform operations on data Example: math operators to perform arithmetic Syntax: set of rules to be followed when writing program Statement: individual instruction used in high-level language

Compilers and Interpreters Programs written in high-level languages such as Python must be translated into machine language to be executed Compiler: translates high-level language program into separate machine language program Machine language program can be executed at any time

Compilers and Interpreters (cont’d.) Interpreter: translates and executes instructions in high-level language program Used by Python language Interprets one instruction at a time No separate machine language program Source code: statements written by programmer Syntax error: prevents code from being translated

Compilers and Interpreters (cont’d.) Figure 1-19 Executing a high-level program with an interpreter

Using Python Python must be installed and configured prior to use One of the items installed is the Python interpreter Python interpreter can be used in two modes: Interactive mode: enter statements on keyboard Script mode: save statements in Python script

Interactive Mode When you start Python in interactive mode, you will see a prompt Indicates the interpreter is waiting for a Python statement to be typed Prompt reappears after previous statement is executed Error message displayed If you incorrectly type a statement Good way to learn new parts of Python

Writing Python Programs and Running Them in Script Mode Statements entered in interactive mode are not saved as a program To have a program use script mode Save a set of Python statements in a file The filename should have the.py extension To run the file, or script, type python filename at the operating system command line

The IDLE Programming Environment IDLE (Integrated Development Program): single program that provides tools to write, execute and test a program Automatically installed when Python language is installed Runs in interactive mode Has built-in text editor with features designed to help write Python programs