Rather proud of this

It’s 30 years Oct 21.

In honor of that I made an assignment for my class:

You find an odd DeLorean parked around the corner. Realizing that Doc Brown has left the keys in the ignition, you decide that a quick trip back to England in 1815 for the purpose of buying the film rights to Pride and Prejudice, Persuasion, and Emma would be remunerative.

As usual, the car fails and you are stranded.

All is not lost, Miss Austen (or her brother Henry, a dashing naval captain) are good company and you decide to settle in for the long haul. She needs a business manager, and having few other practical skills, you volunteer. This means understanding English currency.

Fortunately, you have your laptop, with a python interpreter, and by the use of lemon juice, copper pennies and zinc you are able to rig up a battery to keep it running.

English money is denominated in pounds shillings and pence (L/s/d). There are 12 pence to the shilling and 20 shillings to the pound. Half-pence (hapennies) and quarter-pence (farthings) are used so you must handle sums like 10/4/5 3/4

  1. Write a python program that takes a list of money and sums them correctly.

1/2/3

2/18/9 should sum to 4/1/0

Leading 0’s are usually left off, so 2/6 is 2 shillings and 6 pence.

  1. Make it do subtraction.

2/18/9

– 1/2/3 1/2 should be 1/16/5 1/2

\

Author: rharrisonauthor

International man of mystery. Well not really, although I can mangle several languages and even read the occasional hieroglyphic. A computer scientist, an author and one of the very few people who has both an NIH grant and had a book contract. An ex- booktrope author and a photographer.

%d bloggers like this: