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

Published: 20 October 2022
on channel: 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()


On this page of the site you can watch the video online How to make Age calculator with tkinter in python || Python tips and tricks😄|| @Single CODE with a duration of hours minute second in good quality, which was uploaded by the user Single CODE 20 October 2022, share the link with friends and acquaintances, this video has already been watched 1,376 times on youtube and it was liked by like viewers. Enjoy your viewing!