CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.

Slides:



Advertisements
Similar presentations
CS0004: Introduction to Programming Introduction to Programming.
Advertisements

Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
An Overview of Computers and Programming
1. 2 Chapter 1 Introduction to Computers, Programs, and Java.
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
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.
Chapter 1: Python Basics CSCI-UA 0002 – Introduction to Computer Programming Mr. Joel Kemp.
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
Thanks to: Dr. John S. Mallozzi Department of Computer Science 1. Introduction 2. Overview of programming in Python.
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.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Topics Introduction Hardware and Software How Computers Store Data
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
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.
Python Programming, 2/e1 Python Programming: An Introduction to Computer Science Chapter 1 Computers and Programs.
Computer Science 111 Fundamentals of Programming I Overview of Programming.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 1 Introduction to Computers and Programming.
PYTHON. Python is a high-level, interpreted, interactive and object- oriented scripting language. Python was designed to be highly readable which uses.
Introduction to Programming Peggy Batchelor.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
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”
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Class 1: What this course is about. Assignment Read: Chapter 1 Read: Chapter 1 Do: Chapter 1 ‘workbook’ pages not finished in class Do: Chapter 1 ‘workbook’
I Power Higher Computing Software Development Development Languages and Environments.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 2.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
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.
ECET – Dynamic Programming with Python Spring 2013 Lecture L1 – Introduction to Python Page 1 Welcome! This is Professor Jai P. Agrawal. I will walk.
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 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Chapter – 8 Software Tools.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Chapter 1: Introduction to Computers and Programming.
Introducing Python 3 Introduction to Python. Introduction to Python L1 Introducing Python 3 Learning Objectives Know what Python is and some of the applications.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Fundamentals of Programming I Overview of Programming
Why don’t programmers have to program in machine code?
Development Environment
Chapter 5- Assembling , Linking, and Executing Programs
Writing, Compiling and Running a C program
Introduction to programming
Topics Introduction Hardware and Software How Computers Store Data
Topics Introduction to Repetition Structures
and Executing Programs
Programming languages and software development
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
Compilers and Interpreters
CS 1111 Introduction to Programming Spring 2019
Chapter 1: Programming Basics, Python History and Program Components
General Computer Science for Engineers CISC 106 Lecture 03
Introduction to Computer Science
Presentation transcript:

CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington

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.

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

or newer

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.)

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