Python programming

Python programming Running script from command-line (terminal) • $python script.py # Unix/Linux The “hello” exercis

Views 125 Downloads 0 File size 1MB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

Python programming

Running script from command-line (terminal) • $python script.py

# Unix/Linux

The “hello” exercise • print "Hello, Python”;

Comments and Indentation

Basic Operations

Basic Operationa Example

Comparison Operators

Comparison Operators Examples

Logical Operators

Decision Making

If statement

If statement Example

If else statement

If else statement Example

Aditionally…

Loops

While loop • Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body

While loop example

How would you build an Infinite loop?

For loop • Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable

For loop example