Assignment of Variables and Arithmetic Operations

Variables are used in programs to store data.  Assignment is a term used to process of assigning a value to a variable.

The value assigned to the variable can either be a constant  value or the result of a calculation.

Expressions to Assign Values

name= “Connor”
Or
name=input(“Please enter your name”)

test=50
Or
test=int(input(“Please enter your test mark”))

average=50.40
Or
average=float(input(“Please enter the average”))

Declare variables in python

Initialise Variables in Python

Declare Input Statements in python

 

Declare variables with a calculation

total_pay= hours*rate

 

Arithmetic Operations

Python Examples