Skip to content

Instantly share code, notes, and snippets.

View acrymble's full-sized avatar

Adam Crymble acrymble

  • London
View GitHub Profile
@acrymble
acrymble / python-variable.py
Created June 30, 2011 12:38
Python Variable simple
message = "Hello World"
@acrymble
acrymble / python-concatenate.py
Created June 30, 2011 12:39
Python Concatenate
message1 = 'hello' + ' ' + 'world'
print message1
-> hello world
@acrymble
acrymble / python-multiply.py
Created June 30, 2011 12:40
Python Multiply
message2a = 'hello ' * 3
message2b = 'world'
print message2a + message2b
-> hello hello hello world
@acrymble
acrymble / python-addition.py
Created June 30, 2011 12:40
Python Addition
message3 = 'howdy'
message3 += ' '
message3 += 'world'
print message3
-> howdy world
@acrymble
acrymble / python-len.py
Created June 30, 2011 12:43
Python Len
message4 = 'hello' + ' ' + 'world'
print len(message4)
-> 11
@acrymble
acrymble / python-find.py
Created June 30, 2011 12:43
Python Find
message5 = "hello world"
message5a = message5.find("worl")
print message5a
-> 6
@acrymble
acrymble / python-find-failure.py
Last active September 26, 2015 06:47
Python Find failure
message6 = "Hello World"
message6b = message6.find("squirrel")
print message6b
-> -1
@acrymble
acrymble / python-lowercase.py
Created June 30, 2011 12:45
Python Lowercase
message7 = "HELLO WORLD"
message7a = message7.lower()
print message7a
-> hello world
@acrymble
acrymble / python-replace.py
Created June 30, 2011 12:46
Python Replace
message8 = "HELLO WORLD"
message8a = message8.replace("L", "pizza")
print message8a
-> HEpizzapizzaO WORpizzaD
@acrymble
acrymble / python-slice.py
Created June 30, 2011 12:46
Python Slice
message9 = "Hello World"
message9a = message9[1:8]
print message9a
-> ello Wo