# Chapter 19: Ancient compilers¶

### Example 19.1, Page number: 385¶

In [1]:
# Function declaration
def area (width, height) :
return width * height

# Calculation and result
size = area (3.0, 2)
print ('Area is %f\n' % size)

Area is 6.000000



### Example 19.2, Page number: 386¶

In [2]:
# Function declaration
def square (s) :
return s * s

# Calculation and result
i = square (5)
print ('i is %d\n' % i)

i is 25



### Example 19.3, Page number: 386¶

In [3]:
# Function declaration
def sum (i1, i2, i3) :
return i1 + i2 + i3

# Calculation and result
print ('Sum is %d\n' % sum (1, 2, 3))

Sum is 6



### Example 19.4, Page number: 387¶

In [4]:
# Variable declaration
first = 'John'
last = 'Doe'

# Calculation and result
full = first + ' ' + last
print ('The name is %s\n' % full)

The name is John Doe



### Example 19.5, Page number: 390¶

In [5]:
# Function declaration
def area (width, height) :
return width * height

# Calculation and result
size = area (3.0, 2.0)
print ('Area is %f\n' % size)

Area is 6.000000