Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4b1d75f

Browse files
Added README.md
1 parent c6f2f1c commit 4b1d75f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

‎Age-Calculator-GUI/README.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Age Calculator GUI
2+
3+
In this age calculator app, users can type in their date of birth, and the app will calculate and display their age.
4+
5+
## Step 1:
6+
7+
First of all, we need to import two libraries into our code. The first one is the *tkinter* library. Then, we need the *datetime* library to work with dates.
8+
9+
## Step 2:
10+
11+
Now, let’s create a simple window for our app and name it as *Age Calculator*.
12+
13+
## Step 3:
14+
15+
Then, we are going to create four labels, each for the name, year, month, and the date, and put them in the grid.
16+
17+
We will create entry fields to get the user inputs corresponding to all the labels created. Put them at the right side of the corresponding labels using the *grid* method.
18+
19+
## Step 4:
20+
21+
Then, we are going to define a function, which will calculate the age of the user by subtracting the user’s birth date from today’s date. We name that function as `ageCalc()`.
22+
23+
Then, we create a `Label` area that will display the age of the user as output in the function itself.
24+
25+
## Step 5:
26+
27+
Then, we are going to create a button for users to submit their input values. We link the button to the `ageCalc` function.
28+
29+
Finally, let’s run everything inside the window using the `mainloop()` method.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /