August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.

Slides:



Advertisements
Similar presentations
COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Advertisements

Intro to Python Welcome to the Wonderful world of GIS programing!
 2005 Pearson Education, Inc. All rights reserved Introduction.
2440: 211 Interactive Web Programming JavaScript Fundamentals.
Week 1 basic Python programs, defining functions Special thanks to Scott Shawcroft, Ryan Tucker, and Paul Beck for their work on these slides. Except where.
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
Copyright © 2014 Dr. James D. Palmer; This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Introduction to Python: Slides Referenced in Homework 0 CSE-391: Artificial Intelligence University of Pennsylvania Matt Huenerfauth January 2005.
Python Introduction.
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.
Thanks to: Dr. John S. Mallozzi Department of Computer Science 1. Introduction 2. Overview of programming in Python.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
1 Programming Concepts Module Code : CMV6107 Class Contact Hours: 45 hours (Lecture 15 hours) (Laboratory/Tutorial 30 hours) Module Value: 1 Textbook:
Topics Introduction Hardware and Software How Computers Store Data
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Computer Science 111 Fundamentals of Programming I Overview of Programming.
CSCI/CMPE 4341 Topic: Programming in Python Chapter 1: Introduction to Python Xiang Lian The University of Texas – Pan American Edinburg, TX 78539
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
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.
COMP 171: Principles of Computer Science I John Barr.
Python – Part 1 Python Programming Language 1. What is Python? High-level language Interpreted – easy to test and use interactively Object-oriented Open-source.
Python From the book “Think Python”
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Intro to Python Programming (Part 1) Pamela Moore Zenia Bahorski Eastern Michigan University March 16, 2011 A language to swear by, not at.
Python. History of python  Python was conceived in the late 1980s and its implementation was started in December 1989 by Guido van Rossum at CWI in the.
Variables, Expressions and Statements
Week 1 basic Python programs, defining functions Special thanks to Scott Shawcroft, Ryan Tucker, and Paul Beck for their work on these slides. Except where.
Unit 1 Basic Python programs, functions Special thanks to Roy McElmurry, John Kurkowski, Scott Shawcroft, Ryan Tucker, Paul Beck for their work. Except.
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.
CSC 1010 Programming for All Lecture 2 Introduction to Python Some material based on material from Marty Stepp, Instructor, University of Washington.
8 January 2016Birkbeck College, U. London1 Introduction to Programming Lecturer: Steve Maybank Department of Computer Science and Information Systems
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
1. COMPUTERS AND PROGRAMS Rocky K. C. Chang September 6, 2015 (Adapted from John Zelle’s slides)
Introducing Python 3 Introduction to Python. Introduction to Python L1 Introducing Python 3 Learning Objectives Know what Python is and some of the applications.
Python Fundamentals: Hello World! Eric Shook Department of Geography Kent State University.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
Introduction to Programming
Fundamentals of Programming I Overview of Programming
Introducing Python Introduction to Python.
Introduction to Perl: Practical extraction and report language
CST 1101 Problem Solving Using Computers
A Python Tour: Just a Brief Introduction
GCSE COMPUTER SCIENCE Practical Programming using Python
GCSE COMPUTER SCIENCE Practical Programming using Python
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Python
Lesson 1 An Introduction
Introduction to Programming
Introduction to Programming
Week 1 Gates Introduction to Information Technology cosc 010 Week 1 Gates
Do you know this browser?...
Introduction to Python
Today’s lesson – Python next steps
Week 1 Computer Programming Year 9 – Unit 9.04
basic Python programs, defining functions
Topics Introduction Hardware and Software How Computers Store Data
Section 1 Introduction To Programming
Introduction to Programming
A look at Python Programming Language 2018.
Introduction to Programming with Python
12th Computer Science – Unit 5
Chapter 1: Programming Basics, Python History and Program Components
General Computer Science for Engineers CISC 106 Lecture 03
Introduction to Computer Science
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming Michael Scherger Department of Computer Science Kent State University

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 2 The Game Over Program

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 3 History of Python Created in 1989 by Guido van Rossum –Created as a scripting language for administrative tasks –Based on All Basic Code (ABC) and Modula-3 Added extensibility –Named after comic troupe Monty Python Released publicly in 1991 –Growing community of Python developers –Evolved into well-supported programming language

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 4 History of Python Modules –Reusable pieces of software –Can be written by any Python developer –Extend Python’s capabilities Python Web site at –Primary distribution center for Python source code, modules and documentation

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 5 History of Python Python –Designed to be portable and extensible Originally implemented on UNIX Programs often can be ported from one operating system to another without any change –Syntax and design promote good programming practices and surprisingly rapid development times Simple enough to be used by beginning programmers Powerful enough to attract professionals

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 6 Setting Up Python on Windows Go to and get the latest distribution (2.4.1) –Online tutorials –Python related websites Use the distribution on the CD ROM supplied with the textbook –Examples from the book Use all the defaults when installing

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 7 Python IDLE

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 8 Your First Python Program At the prompt (>>>) type: print “Game Over” –Press [Enter] Very straightforward –You could have guessed what this does without knowing Python!

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 9 Your First Python Program Python is “case-sensitive” –print “Game Over” –Print “Game Over” –PRINT “Game Over”

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 10 Your First Python Program In Python, this computer instruction is called a “statement” –Command (like a verb) (print) –Expression (like a value) (“Game Over”) More specifically, “Game Over” is called a string expression –A series of characters between “ “

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 11 Syntax Errors When the computer does not recognize the statement to be executed, a syntax error is generated Analogous to a misspelled word in a programming language –Bug >>> primt “Game Over” SyntaxError: invalid syntax

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 12 Programming in Script Mode Interactive mode gives you immediate feedback Not designed to create programs to save and run later Script Mode –Write, edit, save, and run (later) Word processor for your code Save your file using the “.py” extension

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 13 Program Documentation Comment lines provide documentation about your program –Anything after the “#” symbol is a comment –Ignored by the computer # Ima P Programmer # First Python Program # September 1, 2005

August 29, 2005ICP: Chapter 1: Introduction to Python Programming 14 Text Examples Game Over Example