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
ListaOriginal = [1,2,3,4,5] | |
print("Original:", ListaOriginal) | |
ListaPalavras = ["Uva","Pera","Banana","Morango"] | |
print("Original:", ListaPalavras,'\n') | |
SomaCinco = list(map(lambda x: x + 5, ListaOriginal)) | |
print("Soma +5 a todos os valores:",SomaCinco) | |
MultiplicaDois = list(map(lambda x: x * 2, ListaOriginal)) | |
print("Multiplica todos os valores por 2:",MultiplicaDois) |
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 urllib | |
import urllib.request | |
from bs4 import BeautifulSoup | |
url = "https://twitter.com/UOL" | |
WebPage = urllib.request.urlopen(url) | |
soup = BeautifulSoup(WebPage,"html.parser") | |
print("Tweet Scraping...") | |
with open("UolTweets.txt","w") as f: | |
for tweets in soup.findAll('div',{"class":"content"}): |
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) |