Why not use Python to calculate Maths formulasMaths symbols used Add + subtract - divide / multiply * User inputs into the program
Perimeter of a square exampleWe know that the perimeter of a square is 4 times the length of one side. Copy the code and paste it into a new Python file to try it.
Line 2 and 3 collect data from the user and store this data in variables called oneside and units. Line 4 multiplies oneside by 4 and puts the new total back into the variable called oneside. Line 5 outputs the total inside oneside and the units inside the variable called units back to the user. Try inputting 22.5 cm Why does it fail? Now try creating your own formulas in Formula Builder2 |