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
# acessar https://apps.twitter.com para criar uma nova aplicação | |
# cada aplicação tem suas próprias chaves | |
import tweepy | |
import re | |
# acessar a aba "Keys and Access Tokens" | |
# passa o Consumer Key e o Consumer Secret | |
auth = tweepy.OAuthHandler('46pvnSwIVylfWepbPsP4433wL', 'xWDPHaUkk0ub93qj1DaYgJcO8QtkPUhNFIE7uBAvzbSVLLpLzR') |
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
from textblob import TextBlob | |
import datetime, random | |
from urllib.request import Request, urlopen | |
import json, time | |
GREETING_KEYWORDS = ("olá", "oi") | |
GREETING_RESPONSES = ["oi, eu sou o BotCoin!", "olá!", "oi, estou a sua disposição...", | |
"olá, estou as suas ordens :)", "oi, estou aqui pra lhe ajudar!"] |
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
from urllib.request import Request, urlopen | |
import json, time | |
def obter_valor(): | |
url = "http://api.coindesk.com/v1/bpi/currentprice.json" | |
req = Request(url, headers={'User-Agent': 'Mozilla/5.0'}) | |
response = urlopen(req).read() | |
data = json.loads(response.decode('utf-8')) | |
valor = float(data['bpi']['USD']['rate'].replace(',', '')) | |
return valor |
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
class Pessoa: | |
def __init__(self, nome, idade): | |
self.nome = nome | |
self.idade = idade | |
def mostrar_nome(self): | |
print(self.nome) | |
def mostrar_idade(self): |
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
#include <stdio.h> | |
#include <string.h> | |
int main() | |
{ | |
char nome[] = "linguagem c"; | |
printf("%s\n" , nome); | |
printf("%d\n" , strlen(nome)); |
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
#include <iostream> | |
#include <string> | |
#include <fstream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
string nome = "Dennis Ritchie"; | |
ofstream out("arquivo.txt"); | |
out << nome; |
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
class Televisao: | |
def __init__(self): | |
self.ligada = False | |
self.canal = 4 | |
tv = Televisao() | |
print(tv.ligada) | |
print(tv.canal) | |
tv.canal = 10 |
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
def encontra_impares(lista): | |
if len(lista) == 0: | |
return [] | |
e = lista.pop(0) | |
if e % 2 != 0: | |
return [e] + encontra_impares(lista) | |
return encontra_impares(lista) | |
print(encontra_impares([1,7,10,12,16,21,3,9,11])) |
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
def maiuscula(funcao): | |
def wrapper(texto): # função que modifica | |
return funcao(texto.upper()) # transforma pra maiúscula | |
return wrapper # retorna a função modificadora | |
@maiuscula | |
def imprimir_mensagem(nome): | |
print('Bem-vindo(a) %s' % nome) | |
imprimir_mensagem('marcos') |
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
>EPlATAT00000000026 ncrna supercontig:ASM34733v1:Scaffold3522:47847:48042:-1 gene:EPlATAG00000000026 gene_biotype:snRNA transcript_biotype:snRNA gene_symbol:U2 description:U2 spliceosomal RNA [Source:RFAM;Acc:RF00004] | |
ATGCCTTCTCGGCCTTTGGACTAAGTTCAAATGTAATATATGTTTTTACTAGTTTATTAA | |
TATATGGTACATGGGTTATGTGCCCACAATGACATGAAATTTACTTTTTGTGGGAGGGTT | |
CATCGGAGTGGCTTGCCATTCGGTTTCTCACTGTCACCCAGACGTTGCACTACTGTTCGG | |
ACTTGGCACCTCCCAA | |
>EPlATAT00000000138 ncrna supercontig:ASM34733v1:Scaffold8836:76017:76205:1 gene:EPlATAG00000000138 gene_biotype:snRNA transcript_biotype:snRNA gene_symbol:U2 description:U2 spliceosomal RNA [Source:RFAM;Acc:RF00004] | |
ATACCTTTCTCGACCTCTTGGCTAAGATCAAGTGTAGTATCTGTTCTTATCAGTTTAATA | |
TCTGATGCACGGATTTACGAATTCATGAGATATTAAGTTAATTTTTTGTGGGGAAGAATC | |
TGCCTATGTATAGCAGTTCTCAAGCGTCGTCTAAGTGTTGCACTATTGCTTGGCACAGGC | |
GCATCCCAA |
NewerOlder