Introduction to Python Origins Nature of Python Importance of Python Example.

Slides:



Advertisements
Similar presentations
Python By Steve Wright. What is Python? Simple, powerful, GP scripting language Simple, powerful, GP scripting language Object oriented Object oriented.
Advertisements

Ruby The Gem of new programming languages. An interpreted scripting language.
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
Scripting Languages. Originally, a script was a file containing a sequence of commands that needed to be executed Control structures were added to make.
Programming Introduction November 9 Unit 7. What is Programming? Besides being a huge industry? Programming is the process used to write computer programs.
Russell Taylor Lecturer in Computing & Business Studies.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Variables, Expressions, and Statements
Python Introduction.
CSC 110 A 1 CSC 110 Introduction to Python [Reading: chapter 1]
CSCI 224 Introduction to Java Programming. Course Objectives  Learn the Java programming language: Syntax, Idioms Patterns, Styles  Become comfortable.
Microsoft Visual Basic 2005: Reloaded Second Edition
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Why Program? Chapter 1 Python for Informatics: Exploring Information
Computer Science 111 Fundamentals of Programming I Overview of Programming.
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
August 29, 2005ICP: Chapter 1: Introduction to Python Programming 1 Introduction to Computer Programming Chapter 1: Introduction to Python Programming.
GNU Compiler Collection (GCC) and GNU C compiler (gcc) tools used to compile programs in Linux.
A very basic overview of Server-Side Scripting Or what is PHP, Perl, Python, Ruby and what can they do for me?
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
Applied Computing Technology Laboratory QuickStart C# Learning to Program in C# Amy Roberge & John Linehan November 7, 2005.
Python – May 11 Briefing Course overview Introduction to the language Lab.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
Introduction to Perl Yupu Liang cbio at MSKCC
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Variables, Expressions, and Statements
Why Program? Chapter 1 Python for Informatics: Exploring Information
Why Program? Chapter 1 Python for Informatics: Exploring Information
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
Quiz 1 A sample quiz 1 is linked to the grading page on the course web site. Everything up to and including this Friday’s lecture except that conditionals.
Python Joseph Eckstrom, Benjamin Moore, Willis Kornegay.
PROBLEM SOLVING WARM-UP Fill in the spaces using any operation to solve the following (!, (), -/+,÷,×): = 6.
How to Get Started With Python
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
Introduction to Programming
Fundamentals of Programming I Overview of Programming
Python Programming Unit -1.
Introduction to Perl: Practical extraction and report language
Top 8 Best Programming Languages To Learn
CST 1101 Problem Solving Using Computers
Agenda Introduction Computer Programs Python Variables Assignment
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
NOCTI Study Guide #2.
Topics Introduction Hardware and Software How Computers Store Data
Introduction to Computer CC111
Introduction Python is an interpreted, object-oriented and high-level programming language, which is different from a compiled one like C/C++/Java. Its.
Introduction to Programming
Variables, Expressions, and Statements
Python for Informatics: Exploring Information
Henning Schulzrinne Advanced Programming
Do you know this browser?...
Introduction to Python programming
What Is a Program? A program is like an algorithm, but describes a process that is ready or can be made ready to run on a real computer Retrieved from:
Introduction to Python
Topics Introduction Hardware and Software How Computers Store Data
Introduction to programming with Python
Variables, Expressions, and Statements
Introduction to Programming with Python
Variables, Expressions, and Statements
Tutorial 10: Programming with javascript
12th Computer Science – Unit 5
Chapter 1: Programming Basics, Python History and Program Components
Why Program? Chapter 1 Python for Everybody
General Computer Science for Engineers CISC 106 Lecture 03
Why Program?. What is Code? Software? A Program? A sequence of stored instructions - It is a little piece of our intelligence in the computer - We figure.
Introduction to Computer Science
Introduction to Python
Programming for Business Computing Introduction
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

Introduction to Python Origins Nature of Python Importance of Python Example

What is Python? Invented by Guido van Rossum in late 1980s in Netherlands. General purpose, high level language intended to be straightforward to read and write. Supports OOP, imperative and functional programming. Dynamic type system and automatic memory management Has large, comprehensive standard library Python is interpreted ◦ Can type a little instruction and process it immediately at the command (or shell) prompt

History Early Python – descendant of ABC that would appeal to UNIX/C programmers Python 2.0 released in 2000 had major new features ◦ Garbage collector ◦ Support for Unicode Python 3.0 – major, backwards-incompatible release in 2008 Now Python – many major features have been backported to the backwards compatible 2.6 and 2.7

Language and Programs Simple language ◦ a beginner can write small useful programs (unlike Perl – only one way to do things) ◦ Sparser, less-cluttered grammar Extensible language ◦ focuses on mechanisms to extend the programming language, compiler and runtime environment ◦ Over 65K packages ◦ GUIs, web frameworks, multimedia, DBS, networking, test frameworks, system admin, scientific computing, text processing and image processing, etc.

Central Characteristics Environment variables - defined by language implementation, not defined by user, but accessible Program variables are implicitly declared ◦ type is inferred by compiler based on name syntax or content ◦ Starts with letter and followed by letters, numbers or _ Numeric types- int, long, float and complex, Booleans are a subtype of int str– popular type in Python, easily converts to/from float float (‘3.14’)  3.14 and str(3.14)  ‘3.14’

A first Script >>> print 'Hello world!' Hello world!

A Second Script >>> x = 6 >>> print x 6 >>> y = x * 7 >>> print y 42 >>>

Programs Typing commands into the Python interpreter is great way to experiment, but not recommended for solving complex problems Use a text editor to write Python instructions and save to a file. Convention is to use the extension.py To execute, at the command prompt your can view and run the program.

Example csev$ cat hello.py print ('Hello world!’) csev$ python hello.py Hello world! csev$

Another example name = input('Enter file:') handle = open(name, 'r') text = handle.read() words = text.split() counts = dict() for word in words: counts[word] = counts.get(word,0) + 1 bigcount = None bigword = None for word,count in counts.items(): if bigcount is None or count > bigcount: bigword = word bigcount = count print (bigword, bigcount)

Getting Python

Learning Resources Python wiki (home page) Python is a interpretive programming language that is about as easy to learn as any. It is heavily used by computer scientist as well as researchers in the other STEM areas. Biology, Physics and Engineering are popular areas where this is applied.wikihome page PythonLearn Tutorial (includes videos, powerpoints etc) PythonLearn Book:Python for Informatics by Charles Severance. Book:Python for Informatics Book:Think Python by Allen Downey Book:Think Python Python Tutorial by UDEMY Python Lectures by Pattis (These are really a nice collection of lectures that are worth reading) Python Lectures by Pattis Python is in Visual Studio You can use Ubuntu (see ubuntu notes) ubuntu notes