“Cálculo de edad en Python” Código de respuesta

Calculadora de edad en 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

Calcular la edad de pitón

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

Cálculo de edad en Python

#AGE CALCULATOION IN PYTHON:

def calculator(age):
    age = (2022 - int(age))
    print("You are "+str(age)+" years Old")
calculator(input("Type your Birth Year: "))

#The easy way to calculate anyones age.Very simple trick.
# Just call a function
YEASIN ARAFAT

Respuestas similares a “Cálculo de edad en Python”

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código