1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Trying to create a method to verify time

Discussão em 'Python' iniciado por Stack, Novembro 29, 2025.

  1. Stack

    Stack Membro Participativo

    I'm new to python and i've been taking some courses to try and get the hang of it, as a proyect to challenge myself i tried to recreate a library method to check for borrowed books and etc. However i wanna do it manually without using python's functions

    However i am kind of lost in how to create the method to verify that the time has the correct format (it's supposed to be dd/mm/2023)

    I've been using this code i found as a guide

    import datetime
    i def check_date(year, month, day):
    correctDate = None
    try:
    newDate = datetime.datetime(year, month, day)
    correctDate = True
    except ValueError:
    correctDate = False
    return correctDate


    but i cannot find a way to make it work by myself

    Continue reading...

Compartilhe esta Página