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
| except_string = "except" | |
| expect_string = s[:2] + s[4:1:-1] + s[5:] |
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 string import ascii_lowercase | |
| def encrypt(plain,offset): | |
| plainId = ord(plain)%97 | |
| cipherId = (plainId+offset)%26 | |
| cipher = chr(97+cipherId).upper() | |
| return cipher | |
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 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" |
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 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" |
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
| 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 |
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
| int gcd(int a, int b){ | |
| if(a%b == 0) | |
| return b; | |
| else | |
| return gcd(b,a%b); | |
| } |