<jupyter_start><jupyter_text><jupyter_code># Python3 code to  calculate age in years
#import the date/time component
from datetime import date

#2:Enter the customer details
first_name = str(input("Enter first Name: "))
last_name = str(input("Enter last Name: "))

#enter_todays_year = int(input("Enter today\'s year: ")) 
today = date.today()
age = today.year - birthDate.year - ((today.month, today.day) < (birthDate.month, birthDate.day))
enter_year_of_birth = int(input("Enter year of birth: "))



##calculate-years = 
#age = date.enter_year_of_birth - today

#get the age
print(age)



#Calories calculation, all we have to do is to multiply the weight (kg), 
#the metabolic equivalent of a task (MET) and the time of the activity (hr). 
#Remember that 1 MET = 1 kcal/kg/hr.
#compute_calories_spent = (enter_weight * enter_time_taken*enter_MET )
#print("Calories burned", compute_calories_spent)
#round the number into 2 decimal places
#print("Calories burned", round(compute_calories_spent,2))
import datetime

import dateutil

def birthday(date):
    # Get the current date
    now = datetime.datetime.utcnow()
    now = now.date()

    # Get the difference between the current date and the birthday
    age = dateutil.relativedelta.relativedelta(now, date)
    age = age.years

    #return age
    #print(age)
import datetime
#2:Enter the customer details
first_name = str(input("Enter first Name: "))
last_name = str(input("Enter last Name: "))
print()
birth_year = int(input("Enter your year of birth: "))
birth_month = int(input("Enter your month of birth: "))
birth_day = int(input("Enter your day of birth: "))
 
current_year = datetime.date.today().year
current_month = datetime.date.today().month
current_day = datetime.date.today().day
 
age_year = current_year - birth_year
age_month = abs(current_month-birth_month)
age_day = abs(current_day-birth_day)

if age_year > 17:
    print ("Yes, you may watch a R-rated movie")
elif age_year >12 <17:
    print ("Yes, you may watch a movie PG-13 rated")   
else:
    print("Yes, you may only watch PG-rated movies.")  
print("----------------------------------------------")
print("because your exact age is: ", age_year, "Years", age_month, "month(s) and", age_day, "days")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1381288614298323, 'fraction_numerical': 0.006619593998234775, 'mean_word_length': 4.284382284382285, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '387478', 'license': 'MIT', 'n_tokens_mistral': 763, 'n_tokens_neox': 724, 'n_words': 226, 'path': 'Calculate_year_based_201.ipynb', 'repo_name': 'gndede/python', 'size': '2266'}