Mensagens

A mostrar mensagens de março, 2024

Feliz Páscoa

print ( """ ______ _ _ _____ __ | ____| | (_) | __ \/_/ | |__ ___| |_ ____ | |__) |_ _ ___ ___ ___ __ _ | __/ _ \ | |_ / | ___/ _` / __|/ __/ _ \ / _` | | | | __/ | |/ / | | | (_| \__ \ (_| (_) | (_| | |_| \___|_|_/___| |_| \__,_|___/\___\___/ \__,_| """ ) def easter_egg (): print ( "Parabéns! Você encontrou um Ovo de Páscoa !" ) print ( " _______ " ) print ( " / \ " ) print ( " / \ " ) print ( " |===========|" ) print ( " |===========|" ) print ( " \ /" ) print ( " \________/" ) # Função principal def main (): print ( "Bem-vindo ao programa secreto." ) resposta = input ( "Você quer ver um Ovo de Páscoa? (sim/não): " ).lower() if resposta== "sim" or resposta== "s" : easter_egg...

Mudança da hora para a hora de verão

print ( """ __ __ _ _ _ _ | \/ | | | | | | | | | | \ / |_ _ __| | __ _ ___ __ _ __| | ___ | |__| | ___ _ __ __ _ | |\/| | | | |/ _` |/ _` |/ __/ _` | / _` |/ _ \ | __ |/ _ \| '__/ _` | | | | | |_| | (_| | (_| | (_| (_| | | (_| | __/ | | | | (_) | | | (_| | |_| |_|\__,_|\__,_|\__,_|\___\__,_| \__,_|\___| |_| |_|\___/|_| \__,_| /\ )_) | | / \__ ____ _ _ __ ___ ___ _ _ _ __ ___ __ _ | |__ ___ _ __ __ _ / /\ \ \ / / _` | '_ \ / __/ _ \ | | | | '_ ` _ \ / _` | | '_ \ / _ \| '__/ _` | / ____ \ V / (_| | | | | (_| __/ | |_| | | | | | | (_| | | | | | (_) | | | (_| | /_/ \_\_/ \__,_|_| |_|\___\___| \__,_|_| ...

Calendário Maia

from tkinter import * from datetime import datetime root = Tk() root.geometry( "400x550" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Calendário Maia" ) titulo = Label( text = "Calendário Maia" , font =( "Arial" , "28" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.13 , rely = 0.05 ) texto_sub1 = Label( text = "Dia:" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.25 , rely = 0.23 ) texto_sub2 = Label( text = "Mês:" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub2.place( relx = 0.25 , rely = 0.35 ) texto_sub3 = Label( text = "Ano:" , font =( "Arial" , "18...

Em memória à Sexta-feira Santa

def desenhar_cruz (): print ( " \t + " ) print ( " \t | " ) print ( " \t +++++++++++++" ) print ( " \t | " ) print ( " \t + " ) print ( "Em memória à Sexta-feira Santa:" ) desenhar_cruz()

Converter Segundos

from tkinter import * root = Tk() root.geometry( "400x400" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Converter Segundos" ) titulo = Label( text = "Converter Segundos" , font =( "Arial" , "28" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.05 , rely = 0.05 ) texto_sub1 = Label( text = "Segundos:" , font =( "Arial" , "20" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.1 , rely = 0.25 ) segundos = StringVar() segundos_entrada = Entry( textvariable =segundos , font =( "Arial" , "12" , "bold" ) , bg = "white" , fg = "blue" , justify = 'center' ) segundos_entrada.place( relx = 0.5 , rely = 0.27 , relwidth = 0.35 ) segundos_entrada.focu...

Calcular crescimento populacional

from tkinter import * import matplotlib.pyplot as plt root = Tk() root.geometry( "500x500" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Calcular crescimento populacional" ) titulo = Label( text = "Calcular crescimento populacional" , font =( "Arial" , "20" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.05 , rely = 0.05 ) texto_sub1 = Label( text = "População Inicial:" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.2 , rely = 0.25 ) texto_sub2 = Label( text = "Taxa crescimento (em %) :" , font =( "Arial" , "18" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub2.place( relx = 0.05 , rely = 0.4 ) texto_sub3 = Label( text = ...

Milhas para km

from tkinter import * root = Tk() root.geometry( "400x400" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Milhas para km" ) titulo = Label( text = "Milhas para km" , font =( "Arial" , "28" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.2 , rely = 0.05 ) texto_sub1 = Label( text = "Milhas Terrestres :" , font =( "Arial" , "15" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.05 , rely = 0.32 ) Milhas_Terrestres = DoubleVar() Milhas_Terrestres_entrada = Entry( textvariable =Milhas_Terrestres , font =( "Arial" , "12" , "bold" ) , bg = "white" , fg = "blue" , justify = 'center' ) Milhas_Terrestres_entrada.place( relx = 0.55 , rely = 0.32 , ...

Classificação da Vaca

from tkinter import * root = Tk() root.geometry( "400x400" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Classificação da Vaca" ) titulo = Label( text = "Classificação da Vaca" , font =( "Arial" , "26" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.05 , rely = 0.05 ) texto_sub1 = Label( text = "Idade:" , font =( "Arial" , "20" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.2 , rely = 0.25 ) Idade = IntVar() Idade_entrada = Entry( textvariable =Idade , font =( "Arial" , "12" , "bold" ) , bg = "white" , fg = "blue" , justify = 'center' ) Idade_entrada.place( relx = 0.5 , rely = 0.28 , relwidth = 0.3 ) Idade_entrada.focus() def limpar (...

Cubo da Soma

from tkinter import * root = Tk() root.geometry( "350x350" ) root.resizable( 0 , 0 ) root.config( bg = "#d9ead3" ) root.title( "Cubo da Soma" ) def app (): va = a.get() vb = b.get() r = pow (va , 3 )+ 3 *va* pow (vb , 2 )+ 3 *vb* pow (va , 2 )+ pow (vb , 3 ) resultado.set(r) def limpar (): a_entrada.delete( 0 , END) b_entrada.delete( 0 , END) titulo = Label( text = "Cubo da soma (a+b)^3" , font =( "Arial" , "15" , "bold" ) , bg = "#d9ead3" , fg = "#bf9000" ) titulo.place( relx = 0.2 , rely = 0.05 ) texto_sub1 = Label( text = "A: " , font =( "Arial" , "12" , "bold" ) , bg = "#d9ead3" , fg = "#bf9000" ) texto_sub1.place( relx = 0.2 , rely = 0.25 ) texto_sub2 = Label( text = "B: " , font =( "Arial" , "12" , "bold" ) , bg =...

Gerar Histórica

import random from tkinter import * root = Tk() root.geometry( "500x300" ) root.resizable( 0 , 0 ) root.title( "Gerar Histórica" ) root.config( bg = "#103030" ) titulo = Label( text = "Gerar História" , font =( "Arial" , "35" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.2 , rely = 0.05 ) def limpar (): resultado_texto.config( text = "" ) def app (): personagens = [ 'o rei' , 'a rainha' , 'o cavaleiro' , 'a bruxa' , 'o dragão' ] acoes = [ 'salvou' , 'enfeitiçou' , 'derrotou' , 'encantou' , 'resgatou' ] objetos = [ 'a espada' , 'o castelo' , 'a poção' , 'a varinha' , 'o tesouro' ] personagem = random.choice(personagens) acao = random.choice(acoes) objeto = random.choice(objetos) mensagem = f"Em u...

Verificar se é Triângulo

from tkinter import * from tkinter import messagebox root = Tk() root.geometry( "400x250" ) root.resizable( 0 , 0 ) root.config( bg = "#103030" ) root.title( "Verificar se é Triângulo" ) titulo = Label( text = "Verificar se é Triângulo" , font =( "Arial" , "23" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) titulo.place( relx = 0.05 , rely = 0.05 ) texto_sub1 = Label( text = "Lado 1 :" , font =( "Arial" , "15" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub1.place( relx = 0.25 , rely = 0.25 ) texto_sub2 = Label( text = "Lado 2 :" , font =( "Arial" , "15" , "bold" ) , bg = "#103030" , fg = "#49e3e3" ) texto_sub2.place( relx = 0.25 , rely = 0.4 ) texto_sub3 = Label( text = "Lado 3 :" , font =...