Utilizei classes e funções para fazer meu calendário!
class Datas():
def __init__(self, dia, semana, calendario):
self.dia = dia
self.semana = semana
self.calendario = calendario
def formatada(self):
print("{}/{}/{}".format(self.dia, self.semana, self.calendario))
ficou assim achei que ficou legal, só fique com dúvida na hora da implementação do mês(semana),
data = Datas(13,02,2024)
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\code.py", line 63, in runsource
code = self.compile(source, filename, symbol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\codeop.py", line 161, in __call__
return _maybe_compile(self.compiler, source, filename, symbol)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\codeop.py", line 73, in _maybe_compile
return compiler(source, filename, symbol, incomplete_input=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\codeop.py", line 126, in __call__
codeob = compile(source, filename, symbol, flags, True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<input>", line 1
data = Datas(13,02,2024)
^
SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integers
data = Datas(13,2,2024)
data.formatada()
13/2/2024