From cb3c10c6dc370d3afb9a484d8ee4db31765be21f Mon Sep 17 00:00:00 2001 From: Andrew Sachien Date: Wed, 18 Mar 2026 14:55:48 +0530 Subject: [PATCH] Added YouTube downloader script --- Age Calculator.py => AgeCalculator.py | 46 +++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) rename Age Calculator.py => AgeCalculator.py (96%) diff --git a/Age Calculator.py b/AgeCalculator.py similarity index 96% rename from Age Calculator.py rename to AgeCalculator.py index af545f45..a4665759 100644 --- a/Age Calculator.py +++ b/AgeCalculator.py @@ -1,24 +1,24 @@ -# Calculate the complete age of a person in years, months and days - -import datetime - -def calculate_age(born): - today = datetime.date.today() - return today.year - born.year - ((today.month, today.day) < (born.month, born.day)) - -def main(): - - # Get the date of birth - dob = input("Enter your date of birth (YYYY-MM-DD): ") - - # Split the date into year, month and day - year, month, day = map(int, dob.split('-')) - - # Calculate the age - age = calculate_age(datetime.date(year, month, day)) - - # Print the age - print("Your age is: {}".format(age)) - -if __name__ == '__main__': +# Calculate the complete age of a person in years, months and days + +import datetime + +def calculate_age(born): + today = datetime.date.today() + return today.year - born.year - ((today.month, today.day) < (born.month, born.day)) + +def main(): + + # Get the date of birth + dob = input("Enter your date of birth (YYYY-MM-DD): ") + + # Split the date into year, month and day + year, month, day = map(int, dob.split('-')) + + # Calculate the age + age = calculate_age(datetime.date(year, month, day)) + + # Print the age + print("Your age is: {}".format(age)) + +if __name__ == '__main__': main() \ No newline at end of file