Plutonic Rainbows

Creating and Amending Lists

A quick example that loops through a predefined list of colours and creates an additional empty list to which a ranger of numbers are added and then printed out.

colors = ['red','blue','green']

assets = []

for colors in colors:
    print "The colours are: %s" % colors

    for n in range(1, 10):
    assets.append(n)

for n in assets:
    print "The number is now: %d" % n

Boolean Rules

One thing I need to learn before I go further with Python is to thoroughly learn the logic rules. Sure, you can just learn the concepts but being able to write actual code will mean memorising these rules.

  • not False = True
  • not True = False

  • True or False = True

  • True or True = True
  • False or True = True
  • False or False = False

  • True and False = False

  • True and True = True
  • False and True = False
  • False and False = False

  • not (True or False) = False

  • not (True or True) = False
  • not (False or True) = False
  • not (False or False) = True

  • not (True and False) = True

  • not (True and True) = False
  • not (False and True) = True
  • not (False and False) = True

  • 1 != 0 True

  • 1 != 1 False
  • 0 != 1 True
  • 0 != 0 False

  • 1 == 0 False

  • 1 == 1 True
  • 0 == 1 False
  • 0 == 0 True

Blockchain Hype

This happens with anything fairly new in the industry. Currently, Blockchain technologies are the magic fairy-dust that will solve all of the security problems, as well as validating everything from photos to news feeds.

Ersin Akinci writing for Medium:

So then why are there so many blockchain startups appearing? Two words: hype and monetization. The hype around blockchains makes fundraising easier if you’ve got one.

Back Again

Moved back to Panic's Transmit after a week or so with Sublime Text. It's too quirky and the workflow is odd. Sometimes more expensive is better.

More Functions

Another attempt at multiplication with slightly better output. Of course, it doesn't need to be math-based - you can use anything. That's the beauty of it.

#multiply two numbers and divide by the third.

def calc(value1, value2, value3):
    return value1 * value2 / value3

value1 = (float(raw_input("\nThe number: ")))

value2 = (float(raw_input("\nMultiplied by: ")))

value3 = (float(raw_input("\nDivided by: ")))

answer = calc(value1, value2, value3)

print "\n{0:.0f} multiplied by {1:.0f} and divided by {2:.0f} is: {3:.1f}\n".format (value1, value2, value3, answer)