How to make Age calculator with tkinter in python || Python tips and tricks😄|| @Single CODE

Publié le: 20 octobre 2022
sur la chaîne: Single CODE
1,376
like

Hello Guys
This video is about how to make Age calculator with tkinter in python. So, hope you all are enjoying this video.

Have a great day!
THANKS FOR WATCHING THIS VIDEO !!

Here is the source code :-

from tkinter import *
from datetime import date

def calculator():
global result
result = str(entry.get())
today = date.today()
dob_data = result.split("/")
date1 = int(dob_data[0])
month = int(dob_data[1])
year = int(dob_data[2])
dob = date(year,month,date1)
numberOfDays = (today - dob).days
age = numberOfDays // 365
label=Label(root, text="Your age is " +str(age))
label.pack()


root = Tk()
root.geometry("300x300")
entry = Entry(root)
entry.pack()

button = Button(root, text="Age", command=calculator)
button.pack()
root.mainloop()


Sur cette page du site, vous pouvez voir la vidéo en ligne How to make Age calculator with tkinter in python || Python tips and tricks😄|| @Single CODE durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Single CODE 20 octobre 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,376 fois et il a aimé like téléspectateurs. Bon visionnage!