Chapter 1 The Meaning of Algebra

Example 1_1 pgno:19

In [1]:
#ex1: no.of pence in x pounds added to y pence

#to express pounds in pence, multiply by 100

x=('x')
x_pounds=100*x; # x_pounds=100*x pence
print' total no. of pence =100x+y '
 total no. of pence =100x+y 

Example 1_2 pgno:19

In [2]:
#ex2:car travels t h at v km/h.how far it go in 20min

#'car goes  1*v km in 1h  2*v km in 2h  ...  t*v km in th'
x=20./60.;
print'\ncar travels *vkm in 20min',x
car travels *vkm in 20min 0.333333333333

Example 1_3 pgno:19

In [2]:
#ex3

x='x'#is polynomial function of degree zero poly(0,'x');
y='y'#is polynomial function of degree zero poly(0,'y');
sum1='3*x+5';
divisor='4*y';
print"result in algebraic form: \n(3*x+5)/(4*y)"
result in algebraic form: 
(3*x+5)/(4*y)