Operators and other constants - BenWare-FED/Python GitHub Wiki

Arithmetic Operators:

addition = +

subtraction = -

multiplication = *

true(complete) division= / The output of this operator will always be a float ex 15/4= 3.75 16/4 = 4.0

Integer division or quotient after long division=// The output will always be an integer

remainder after long division = % The output will always be an integer 15%4 = 3

exponent = ** ex: 2**3 is 2 cubed

greater than = >

greater than or equal to = >=

less than = <

less than or equal to = <=

equal to = == Important note: a single = will be used to assign a variable a value

not equal to !=

Logical operators

Both inputs and outputs are always booleans

make sure that everything is grouped ex if (original_scale == 'C') or (original_scale == 'c'):

and: Both inputs must be true for the output to be true

or: Output is true if one input is true

not: Output is false if the input is true