top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

AGE Calculator using Python

Writer: Vanessa ArhinVanessa Arhin


Age is an important concept of life. The age of an non-living or living thing is used to how old it is. Age is usually calculated using the time something begins to exist and current time/the time it stops existing.

This article contains a program that calculates the period of existence in years. From the date it begins to existence to the current date, given that the user provides the date it begins to exist.


The user has to provide the year, month and day, all in figures.

year = int(input('Enter your year of birth(yyyy):'))
month = int(input('Enter your month of birth(mm):'))
day = int(input('Enter your day of birth(dd):')) 

The program then subtracts the date provided by the user from the current date depending on their geographical location.



current_date = dt.datetime.now()
start_date = dt.datetime(year,month, day)

years = (current_date - start_date)/365

years = str(years)


The age in years, is then displayed.



 
 

1 Comment


Data Insight
Data Insight
Sep 18, 2021

Nice. But no examples given.

Like

COURSES, PROGRAMS & CERTIFICATIONS

 

Advanced Business Analytics Specialization

Applied Data Science with Python (University of Michigan)

Data Analyst Professional Certificate (IBM)

Data Science Professional Certificate (IBM)

Data Science Specialization (John Hopkins University)

Data Science with Python Certification Training 

Data Scientist Career Path

Data Scientist Nano Degree Program

Data Scientist Program

Deep Learning Specialization

Machine Learning Course (Andrew Ng @ Stanford)

Machine Learning, Data Science and Deep Learning

Machine Learning Specialization (University of Washington)

Master Python for Data Science

Mathematics for Machine Learning (Imperial College London)

Programming with Python

Python for Everybody Specialization (University of Michigan)

Python Machine Learning Certification Training

Reinforcement Learning Specialization (University of Alberta)

Join our mailing list

Data Insight participates in affiliate programs and may sometimes get a commission through purchases made through our links without any additional cost to our visitors.

bottom of page