Skip to content

evansnjagi/AutomateWith-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutomateWith-Python

Learning how to automate things using python.

We will learn to automate simple tasks using python. Those tasks includes but not limited to the following

  • Moving, renaming and sorting thousands of files
  • Filling out an online file
  • Downloading text or files to your phone
  • Updating and formatting excel spreadsheets
  • Checking your email as well as sending pre-written responses
  • Creating and querying databases
  • Extracting text and images from audio files.

Important terms:

  1. Programming - Written instructions to a computer to do a specific task. These instructions are written in a language the computer understands.

2. Expression - It's a single value evaluation that always consist of a value and an operator

Variable names should describe the data type it contains and should be simple to understand. A variable therefore, is like a container or box in computer memory where you can store a single value. In python we use assignment statements (=) to assign a variable. **Note** Variable names can not have the following:

  - Can't have spaces

  - Can't begin with a number

  - Can't be a python keyword.

Remember that variable names are case sensitive. There are two mostly used cases to separate words. **camelCase** and **snake_case**

What happens under the hood? Computers use binary(base-2) number system because hardware can easily represent two stages. A bit is the smallest data unit (0,1) while a byte has 8 bits. A byte represents 256 values. From there the storage grows exponentially from Kb($2^10$), Mb($2^20$),Gb($2^30$),Tb($2^40$) and so on.

## Flow control.

A program is a series of instructions and in most cases we don't want the program to excude all lines of code. This is where flow control comes in. Flow control statements decide which python instructions to execute under certain conditions.

Let us explore a little on boolen expression and operators(from Gorge Boolen). We have three most common boolean opearators and two boolean expressions. The two boolean expression are:

  - True

  - False

While the three boolean expression are:

  - And

  - Or

  - Not

The boolen and and or are considered as binary boolean operators because they check/ evaluate between two boolean expressions(values) while the boolean operator not is a unary boolean expression and it simply operate the opposite boolen.

**Note** Boolean expression also follow order of operation just like in maths. The boolean expression not is operated first, then and and finally or operator.

Components of control flow:

There are two main components included in control flow statements:

  1. Condition - This is the content of the control statement and always evaluate to a boolean value(True or False).
  2. Block of code - These are grouped lines of code. A block of code satisfies the followind conditions:

  - A new block begins when indentation increase

About

Learning how to automate things using python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages