Calcular a data do Carnaval e da Páscoa
Publicado por Jose Carlos Rocha (última atualização em 28/01/2015)
[ Hits: 5.852 ]
Download calc_pascoa_e_carnaval.py
Este script faz o cálculo das datas do carnaval e da páscoa dos anos entre 1901 e 2099.
#!/usr/bin/env python # -*- coding: utf-8 -*- # # utilitarios.py # # Copyright 2015 José Carlos Rocha <jcr0ch4@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # # from datetime import date X = 24 Y = 5 ANO = int(raw_input("Informe o ANO :")) A = ANO % 19 #print A B = ANO % 4 #print B C = ANO % 7 #print C D = ( 19 * A + X ) % 30 #print D E = ( 2 * B + 4 * C + 6 * D + Y ) % 7 #print E if ( (D + E ) > 9 ): DIA = D + E - 9 print "A Pascoa sera dia "+str(DIA)+" de Abril" MES = 04 DATA1 = date(ANO, MES, DIA ) # O carnaval sera a subtração de 47 dias da data da pascoa CARNAVAL = date.fromordinal(DATA1.toordinal()-47 ) print "O Carnaval sera na data :"+str(CARNAVAL) else: DIA = D + E + 22 print "A Pascoa sera dia "+str(DIA)+" de Março" MES = 03 DATA1 = date(ANO, MES, DIA ) CARNAVAL = date.fromordinal(DATA1.toordinal()-47 ) print "O Carnaval sera na data :"+str(CARNAVAL)
Aprendendo a fazer equaçõe em python
Como agendar um backup automático do PostgreSQL no Cron evitando o problema de senha
Como preparar o Vim/Neovim para corrigir ortografia em português
Dark Web e Malwares na internet, quanto custa?
Configuração básica do Conky para mostrar informações sobre a sua máquina no Desktop
Como verificar o hash de um arquivo baixado da Internet e como criar um hash
Debian 12 - IPTABLES - removendo NFTABLES
OverWatch 2 - Abrindo portas do jogo no Iptables.
Como instalar o adaptador wifi USB Intelbras ACtion A1200 no Linux Mint
Como normalizar seus arquivos MP3 para que fiquem no mesmo volume
Erro no brave no Ubuntu 22.04.4 LTS (16)
Instalando e compilando o GCC/G++ erro (5)
WACOM Intuos no Ubuntu - muita dificuldades (1)
Instalação do Programa Imposto de Renda Pessoa Física 2023 [RESOLVIDO]... (6)
[C/C++] BRT - Bulk Renaming Tool
[Shell Script] Criação de Usuarios , Grupo e instalação do servidor de arquivos samba
[Shell Script] Tire screenshots com Scrot facilmente com Zscrot
[Shell Script] DioPSI - Script multidistro para instalar programas
[Shell Script] ARS Vídeos - Cortador de vídeos e webcam shooter