Creating Python Program

Student Name:

Name of Institution:

Python is a programming language that is interactive and objective. It is a very vital programming tool because it can incorporate extremely high data types that are as well dynamic and can be applied to many different classes of problems. Python is text file and can be edited by use of an editor program that is standard (Guido & Jelke, 2001). The choice of an editor text closely depends on the system of operation although a python program can be created by any text editor. The created python program can then be used in the study of continued fraction expansion.

Mathematically, a continued fraction is obtainable by a frequentative process of expressing a number as the sum of its integer part and to other number as the reciprocal then this other number is the sum of its integer and another reciprocal and so forth.

Below is a basic formulae of a continued fraction expression.

Where a0 is an integer, any other ai members are positive integers, and n is positive

Developing a python program

integer.def universal_distro(L=10000):

Import random

y= random.random()

h = list()

r= dict()

p = dict()

L= len(o)

while L < 10000:

for y in range[0,1]:

w = number2cfe(y,L=15)

e = w[n]

if n < 15:

count = 0

If w[n] not in g:

for e in w:

if e == w[n]:

count += 1

g.append(w[n])

n += 1

r[w[n]] = count

for k in m.keys():

if o.has_key(k):

o[k] += r[k]

else:

o[k] = r[k]

N += 1

Studying fraction by use of a python program

import fractions 1

y = fractions. Fraction (1, 3) 2

y

Fraction (1, 3)

y * 2 3

Fraction (2, 3)

Fraction (6, 4) 4

Fraction (3, 2)

Fraction (0, 0) 5

Trace back (most recent call last):

File “<stdin>”, line 1, in <module>

File “fractions.py”, line 76, in __new__

0 Error DIV(‘Fraction(%s, 0)’ % numerator)

ZeroDivisionError: Fraction(0, 0)

For augmented assignment statements:

augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)

augtarget ::= identifier | attributeref | subscription | slicing

augop ::= “+=” | “-=” | “*=” | “/=” | “//=” | “%=” | “**=”

| “>>=” | “<<=” | “&=” | “^=” | “|=”

To start using fractions, import the fractions module.

To define a fraction, create a Fraction object and pass in the numerator and denominator.

All expressions with fractions are solvable. Operations change new Fraction object 2 * (1/3) = (2/3)

The Fraction object will automatically reduce fractions. (6/4) = (3/2)

Python program eliminates the chances of creating zero in the denominator of a fraction.

References

Guido van, R. & Jelke de, B. (2001). Interactively Testing Remote Servers Using the Python Programming Language. Amsterdam: Longman Publishers pp. 283-303.