Sunday, 7 December 2014

Insertion Sort Iteration counting (A2)



using the code above (an insertion sort) i have passed a 3 lists of data through to see how many iterations the data needs to be sorted, the results are as follows.





Wednesday, 24 September 2014

Classes, __init__, __str__ (A2)

In this i have created a class, within this class a have created 3 methods (functions with a class). I used __init__ which initialises the methods inside the class, I also use __str__ which displays the instance a string.

Stacks & Queues (A2)

In this i make some list into stacks and queues. A stack is a list with a first in last out system, a queue is a list with a first it first out system.

Nested Lists and Indexing (A2)

Further improving the mail merge code, this time using 2D arrays (nested lists). I also added a system that allow the user to input a index number and it will return the data in that index position. 

Using Mathematical Symbols (AS)

Pretty self explanatory, using different symbols in python to achieve  the same result

Sunday, 14 September 2014

Passing Parameters (A2)

Similar to passing arguments, in this i'm using the basic mail merge idea and coding it to have usernames, passwords, and student names. i have set up three list respectively. I have used the same structure as in the passing arguments post but i have added and improved it a small amount. I have placed the main program in a while loop allowing the user to enter more than one set of data, this uses a yes/no restart. Also in the main() i have set it to save the data that has been entered by the user to save to the corresponding lists.

Passing Arguments (A2)

Defining a function which emulates a extremely basic mail merge. Instead of hard coding the name i passed the argument from 'entername' to replace 'name', this allows the user to enter the name they want into the mail merge.

Assigning Variables a numerical value (AS)

Assigning variables a numerical value and messing around with basic mathematical problems.