<em>Bad Code</em>

Longest Seven-Segment Word | <em>Bad Code</em> [4]

What It Does A program that finds the longest word in the English language that can be represented by a seven-segment display. Watch Tom Scott’s video for more information – this program was made as a response. It turns out there is only one longest word that meets the criteria… # words.txt from GitHub file linked at …

<em>Bad Code</em>

Bubble Sort | <em>Bad Code</em> [3]

What It Does This is my own version of the simple sorting algorithm bubble sort. The function takes the numbers 1 to 9  in a random order, and re-sorts them into ascending order. The first value is compared with the second value: if the first is greater than the second, their locations in the list …

Reviews

The Dictator’s Handbook: Why Bad Behaviour is Almost Good Politics | Reviews [1]

Why do politicians act the way they do? This is the simple question (with a somewhat lengthier answer) that Bruce Bueno de Mesquita and Alastair Smith attempt to answer in The Dictator’s Handbook. Aimed at anyone who is interested in understanding the logic behind political decisions, the authors take a common sense approach in explaining …

<em>Bad Code</em>

Fibonacci Sequence & Pascal’s Triangle | <em>Bad Code</em> [2]

The first 15 rows of Pascal's Triangle

  Two short pieces of code – one for generating the first n terms of the Fibonacci Sequence, the other for generating the first n rows of Pascal’s Triangle.     #Function to generate the Fibonacci sequence to the nth term index = int(input(“Please enter the number of terms in the Fibonacci sequence to display:\n”)) …

<em>Bad Code</em>

Cambridge Colleges and Founding Years, Re-Designed | <em>Bad Code</em> [1.5]

New and Improved Here’s a drastically modified version of the program that I wrote yesterday, using dictionaries instead of arrays. # Alistair Bhatti # 31/01/2017 data = {“Christ’s College”:”1505″, “Churchill College”:”1960″, “Clare College”:”1326″, “Clare Hall”:”1965″, “Corpus Christi College”:”1352″, “Darwin College”:”1964″, “Downing College”:”1800″, “Emmanuel College”:”1584″, “Fitzwilliam College”:”1869″, “Girton College”:”1869″, “Gonville & Caius College”:”1348″, “Homerton College”:”1768″, “Hugh’s …

<em>Bad Code</em>

Cambridge Colleges & Founding Years | <em>Bad Code</em> [1]

What It Does This is a program that allows the user to input the name of one of the colleges of Cambridge, such as Clare College for instance, and the year that College was founded, ie 1326, is output. # Alistair Bhatti # 30/01/2017 names = [“Christ’s College”,”Churchill College”,”Clare College”,”Clare Hall”, “Corpus Christi College”,”Darwin College”,”Downing …