Posts

Showing posts from February, 2025

Age calculator

from datetime import datetime def calculate_age(birthdate): today = datetime.today() birth_date = datetime.strptime(birthdate, "%Y-%m-%d") age = today.year - birth_date.year - ((today.month, today.day)