This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3t3+VaQwviqMwjLyRYCIvc2pyMo9G5hamc9Aj2TYsZsFO6imfyyM4amaenlrGkMOMXke6ZJNRJ4Uv6xdDzD74cmF9NS66flEL0fBTVIiuhrr1d/qvNY7Zu7XWxKvXMcMmfm2x2pDQfRGKcOfr6A2r8MZ+SWkhASdo2zZYNzBETfgICmhGsl/+qCFshbgH1mmngCA2w9qUXPf6P3a4ZOBu8wg8gJ0xt+7oA5rXiSqTl3biZ5z9pyIL99JIABnvNwDwbVZPbPIEv37/wZNV0yLrDMqCeV1EjlflyurMCTydJE8h3Bhex6lX2w0stsx9TnP0niJJFE7JnCHR1e2ooqZr [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| grade = input("What was the grade? ") | |
| if grade >= 0 and grade <=39: | |
| print("Fail.") | |
| elif grade >= 40 and grade <= 59: | |
| print("Pass.") | |
| elif grade >= 60 and grade <= 79: | |
| print("Merit.") | |
| elif grade >= 80 and grade <=100: | |
| print("Distinction.") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Download a dictionary | |
| # see https://stackoverflow.com/questions/18834636/random-word-generator-python | |
| from urllib.request import urlopen | |
| import random | |
| wordsURL = "http://svnweb.freebsd.org/csrg/share/dict/words?view=co&content-type=text/plain" | |
| response = urlopen(wordsURL) | |
| wordList = response.read().splitlines() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| import random | |
| import threading | |
| class game: | |
| def __init__(self): | |
| self.number = random.randint(1, 30) | |
| def guess(self, number): | |
| distance = abs(self.number - number) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| matrix = [[0, 1, 2, 3], [1, 0, 5, 6], [2, 5, 0, 4], [3, 6, 4, 0]] | |
| print "A to C" | |
| print matrix[0][2] | |
| print "D to B" | |
| print matrix[3][1] | |
| print " |A|B|C|D" | |
| print "A|%d|%d|%d|%d" % (matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0]) | |
| print "B|%d|%d|%d|%d" % (matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1]) | |
| print "C|%d|%d|%d|%d" % (matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a=lambda f, m:open(__import__('sys').argv[f],m);if not raw_input("File %d bytes\nEnter continue, CTRL-C abort." % len(a(1, 'r').read())):a(2, 'w').write(a(1, 'r')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print "Format Characters:" | |
| print "d OR i: int" | |
| print "o: octal" | |
| print "x: lowercase hex" | |
| print "X: uppercase hex" | |
| print "f OR F: float" | |
| print "c: single char" | |
| print "r: String (using repr())" | |
| print "s: String (using str())" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print "So you want to call a baby ugly?" | |
| def parent(parent): | |
| print "If the {0} strong or able to beat you up?".format(parent) | |
| print "Say N if you're not sure" | |
| answer=raw_input("Y or N: ") | |
| if answer == "Y": | |
| return True | |
| else: | |
| return False | |
| father=parent("father") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from sys import argv | |
| if len(argv)>1 and argv[1].isdigit(): | |
| r = '' | |
| for i in range(int(argv[1])): | |
| r+='r' | |
| print "oh hai thu{0}".format(r) | |
| else: | |
| print "Please supply a positive integer as an argument" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Earthquake.init do | |
| output do |item| | |
| next unless item["_stream"] | |
| if "#{item["text"]}".match(/@leegeorg07/) | |
| notify "#{item["user"]["screen_name"]}: #{item["text"]}" | |
| end | |
| end | |
| end |
NewerOlder