Plutonic Rainbows

Memorizing Logic

Today, I will start trying to memorise the Truth Terms. Basically if something is true or false. These symbols forms combinations to tell Python what to do in a given situation. Now it's just a case of making them stick in my mind. Most of them seem fairly self-explanatory.

and

or

not

!= (not equal)

== (equal)

>= (greater than equal)

<= (less than equal)

True

False

Adding

I wrote a simple script for adding that uses a function to hold two variables and then add them together. You create a function by using def and then giving it a name.

# -*- coding: utf-8 -*-

def add(value_1, value_2):
    print "Adding %d and %d together." % (value_1, value_2)
    return value_1 + value_2

cost = add(2345,1234)

print "The cost is: £{0:.2f}".format (cost)

Be sure to use the utf-8 value at the top or else Python will not understand the currency character.

Dedekind Cut - Tahoe

Great new album from Lee Bannon. Tahoe has huge, cinematic sweeps often accompanied by feelings of sadness or unresolved strife. A really excellent addition, if you're into atmospheric ambient works.

Calculating Time

Simple script to calculate days between two dates.

from datetime import *

today = date.today()
past_date = date(1994,2,10)
diff = today - past_date
print "That was %d days ago." % diff.days

I don't understand the need for the asterisk on the first line.

Terekke - Improvisational Loops

Pure 80s ambient style bliss now available on the Music From Memory label. You can order it here.