Skip to content

Instantly share code, notes, and snippets.

except_string = "except"
expect_string = s[:2] + s[4:1:-1] + s[5:]
from string import ascii_lowercase
def encrypt(plain,offset):
plainId = ord(plain)%97
cipherId = (plainId+offset)%26
cipher = chr(97+cipherId).upper()
return cipher
from string import ascii_lowercase
plainText = ""
cipherText = (
"JNRZR BNIGI BJRGZ IZLQR OTDNJ GRIHT USDKR ZZWLG OIBTM NRGJN IJTZJ LZISJ NRSBL QVRSI ORIQT"
"QDEKJ JNRQW GLOFN IJTZX QLFQL WBIMJ ITQXT HHTBL KUHQL JZKMM LZRNT OBIMI EURLW BLQZJ GKBJT"
"QDIQS LWJNR OLGRI EZJGK ZRBGS MJLDG IMNZT OIHRK MOSOT QHIJL QBRJN IJJNT ZFIZL WIZTO MURZM"
"RBTRZ ZKBNN LFRVR GIZFL KUHIM MRIGJ LJNRB GKHRT QJRUU RBJLW JNRZI TULGI EZLUK JRUST QZLUK"
"EURFT JNLKJ JNRXR S"
import urllib
from datetime import datetime
blog= raw_input("blog name: ")
if ".tumblr.com" not in blog:
blog = blog+".tumblr.com"
url ="http://api.tumblr.com/v2/blog/" + blog +"/info?api_key=H7sBfGGtuNcTds7SM58iXxSmkeUNXk5DP7k7L54AZMsa6hjPDX"
n = 1000
ints = range(2,n+1)
factor=0
while(factor<len(ints)):
for i in range(len(ints)-1,factor, -1):
if ints[i]%ints[factor]==0:
ints.pop(i)
index=index+1
@yankees714
yankees714 / euclidean.c
Created October 14, 2012 15:48
Implementation of the Euclidean algorithm
int gcd(int a, int b){
if(a%b == 0)
return b;
else
return gcd(b,a%b);
}