introduction to the jj ii python programming language · 2015. 5. 20. · python programming...

8
Why Python Python Usage What’s a Programmer Modes of usage Data Types Assignment Operators JJ II J I Slide 1 of 8 Go Back Full Screen Quit Introduction to the Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy

Upload: others

Post on 12-Sep-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 1 of 8

Go Back

Full Screen

Quit

Introduction to the

Python Programming Language

Command-line Programming

May 20, 2015Brian A. Malloy

Page 2: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 2 of 8

Go Back

Full Screen

Quit

1. Why Python

• Python is fun!• Powerful

• Versatile

• Not a dragon to be slain

Page 3: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 3 of 8

Go Back

Full Screen

Quit

2. Python Usage

• Scripting

• Rapid Prototyping

• Python is a helpful dragon

Page 4: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 4 of 8

Go Back

Full Screen

Quit

3. What’s a Programmer

• Someone who writes code

• Writes computer software

https://www.youtube.com/watch?v=OWsyrnOBsJs

=⇒

Page 5: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 5 of 8

Go Back

Full Screen

Quit

4. Modes of usage

• Command line: type python at a terminal:

• File:

– Use an editor to put commands in afile called hello.py

– type python hello.py

Page 6: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 6 of 8

Go Back

Full Screen

Quit

5. Data Types

• Integer: 4, -9

• Float: 4.3, -9.2, 0.5

• String: ”hello”, ’good bye’

Page 7: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 7 of 8

Go Back

Full Screen

Quit

6. Assignment

• Variables: begin with letter, followed by let-ters or digits:x, sum, name1, name2, . . .

• Move what is on the right hand side to thememory location designated by the vari-able on the left side:x = 17

• Not an equation:x = x + 1

Page 8: Introduction to the JJ II Python Programming Language · 2015. 5. 20. · Python Programming Language Command-line Programming May 20, 2015 Brian A. Malloy. Why Python Python Usage

Why Python

Python Usage

What’s a Programmer

Modes of usage

Data Types

Assignment

Operators

JJ II

J I

Slide 8 of 8

Go Back

Full Screen

Quit

7. Operators

• +, -, *, /, **