introduction to the jj ii python programming language · 2015. 5. 20. · python programming...
TRANSCRIPT
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
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
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
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
=⇒
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
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’
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
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
• +, -, *, /, **