import math
num = ('nought', 'one', 'two', 'three', 'four', 'five',
'six', 'seven', 'eight', 'nine')
print('three point ', end='')
for i in str(math.pi)[2:10]:
print(num[int(i)], end=' ')
print()
This program turns math.pi
into a string and picks off the first eight decimal places to use as indexes to the tuple of number names. The output is:
three point one four one five nine two six five