Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c29e5f6e
authored
Sep 22, 2017
by
likorn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload lab3
parent
1586b7f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
lab3/lab3.py
lab3/lab3.py
0 → 100644
View file @
c29e5f6e
import
datetime
today
=
datetime
.
date
.
today
()
print
(
"Enter your birth date "
)
year
=
int
(
input
(
"year: "
))
month
=
int
(
input
(
"month: "
))
day
=
int
(
input
(
"day: "
))
b_day
=
datetime
.
date
(
year
,
month
,
day
)
next_b_day
=
datetime
.
date
(
today
.
year
+
1
,
b_day
.
month
,
b_day
.
day
)
age
=
today
.
year
-
b_day
.
year
print
(
"You're "
+
str
(
age
)
+
" years old"
)
if
(
b_day
.
month
==
today
.
month
)
and
(
b_day
.
day
==
today
.
day
):
print
(
"Happy b-day!"
)
else
:
days_left
=
next_b_day
-
today
print
(
"There're "
+
str
(
days_left
)
+
" left"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment