Last active
September 20, 2016 12:35
-
-
Save dionnys5/18b4647cd440d7ff300ffa3ad6127d99 to your computer and use it in GitHub Desktop.
Python Random
This file contains 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 string | |
phrase = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr "\ | |
"gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq()"\ | |
"gq pcamkkclbcb. lmu ynnjw ml rfc spj!" | |
norm= "abcdefghijklmnopqrstuvwxyz" | |
decrip= "cdefghijklmnopqrstuvwxyzab" | |
trantab = phrase.maketrans(norm, decrip) | |
print(phrase.translate(trantab)) | |
#Second Code | |
'''' | |
origin = "abcdefghijklmnopqrstuvwxyz" | |
letters = "cdefghijklmnopqrstuvwxyzab" | |
new = "" | |
for i in (phrase): | |
if i in origin: | |
new = new+letters[origin.index(i)] | |
else: | |
new = new+i | |
print(new) | |
''' |
This file contains 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
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Sep 19 03:20:13 2016 | |
@author: dionnys | |
""" | |
import re | |
data1 = open("doc.txt","r") #data extracted from webpage | |
data = data1.read() | |
print ("".join(re.findall("[A-Za-z]", data))) | |
data.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment