“Calculateur d'âge à Python” Réponses codées

Python calcule l'âge de la date de naissance

from datetime import date

def calculate_age(born):
    today = date.today()
    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
VasteMonde

Calculateur d'âge à Python

import datetime 
Year_of_birth = int(input("In which year you took birth:- "))
current_year = datetime.datetime.now().year
Current_age = current_year - Year_of_birth
print("Your current age is ",Current_age)
Programmer of empires

Python calcule l'âge de la date de naissance

#Python Calculate Age from date of birth:

from datetime import date

def calculate_age(born):
    today = date.today()
    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
Xabos

Calculer l'âge Python

from datetime import date

def calculate_age(born):
    today = date.today()
    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
Talented Tiger

Calculateur d'âge à Python


from datetime import date

def calculate_age(born):
    today = date.today()
    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))

Perfect Pelican

Réponses similaires à “Calculateur d'âge à Python”

Questions similaires à “Calculateur d'âge à Python”

Plus de réponses similaires à “Calculateur d'âge à Python” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code