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.request | |
url = 'http://www.portaltransparencia.gov.br/copa2014/api/rest/empreendimento' | |
resp = urllib.request.urlopen(url).read().decode('utf-8') | |
total = 0 | |
j = 0 | |
while True: | |
abre = '<valorTotalPrevisto>' | |
fecha = '</valorTotalPrevisto>' | |
j = resp.find(abre, j) | |
if j == -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
#The context of this program is a course of an hour to journalists who know nothing about programming in a lab with Python 3 only. | |
import urllib.request | |
url = 'http://www.portaltransparencia.gov.br/copa2014/api/rest/empreendimento' | |
resp = urllib.request.urlopen(url).read().decode('utf-8') | |
total = 0 | |
j = 0 | |
and1 = '<andamento>' | |
and2 = '</andamento>' | |
abre = '<valorTotalPrevisto>' | |
fecha = '</valorTotalPrevisto>' |
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
#The context of this program is a course of an hour to journalists who know nothing about programming in a lab with Python 3 only. | |
import urllib.request | |
import json | |
def analisa_detalhe(cod): | |
url = 'http://educacao.dadosabertosbr.com/api/escola/' | |
resp = urllib.request.urlopen(url+str(cod)).read() | |
resp = json.loads(resp.decode('utf-8')) | |
if int(resp['salasExistentes']) > 1: | |
print ('Salas Existentes:', resp['salasExistentes']) |
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
#Chamando as bibliotecas necessárias | |
import string | |
import urllib.request | |
import os | |
import random | |
import sys | |
#Declarando uma lista com os desenhos do Jogo | |
forca = [''' | |
--------------------------------------------------------- |
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
#Função que soma os dois números digitados | |
def sum(num1, num2): | |
return num1 + num2 | |
#Atribui valores nas variáveis | |
print("\tSoma de dois números\n") | |
num1 = int(input("Digite um número: ")) | |
num2 = int(input("Digite outro número: ")) | |
#Imprime resultado na tela |
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
{ | |
// Desabilitar a página de "Welcome" | |
"workbench.startupEditor": "newUntitledFile", | |
// Aplica tema "Dracula Official" | |
"workbench.colorTheme": "Dracula", | |
// Ativa o "Power Mode" | |
"powermode.enabled": true, | |
// Aplica o tema "flames" no Power Mode | |
"powermode.presets": "flames", | |
// Aplica um sinal visual na esquerda da linha selecionada |
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
#Atribui valores nas variáveis | |
print("\tSoma de dois números\n") | |
numero_1 = int(input("Digite um número: ")) | |
numero_2 = int(input("Digite outro número: ")) | |
#Soma os dois números digitados | |
soma = numero_1 + numero_2 | |
#Imprime resultado na tela | |
print ("") |
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
print("\tConversão de Metros para Milímetros\n") | |
#Inserindo valor | |
metros = float(input("Metros: ")) | |
#Calculando conversão | |
milimetros = (metros * 1000) | |
#Imprimindo resultado na tela | |
print("") |
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
print("\tConversão em Segundos\n") | |
#Entrada de dados | |
dias = int(input("Dias: ")) | |
horas = int(input("Horas: ")) | |
minutos = int(input("Minutos: ")) | |
segundos = int(input("Segundos: ")) | |
#1 dia = 24 horas = 1440 min = 86400 seg | |
#1 hora = 60 min = 3600 seg |
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
print("\tAumento de Salário\n") | |
#Entrada de dados | |
salario = float(input("Salário R$: ")) | |
porcentagem_aumento = int(input("% aumento: ")) | |
#Calculo Aumento | |
aumento = salario + (salario * (porcentagem_aumento / 100)) | |
#Imprimindo valor na tela |
OlderNewer