I'm studying basic Python. I have a question

Asked 2 years ago, Updated 2 years ago, 120 views

We are trying to create an age notification system using the difference between dates. But the date mark that I've known so far is date mark like this (2019, 11, 30) through the date grave. But I want to set one date as November 30, 1999 and divide the input into three lines. The date on line 1, the month on line 2, the year on line 3. What method should I use in this case?

(Input) 4 may 2016

(Output) Stopwatch babies are 4 days, 5 months and 16 years old on 4 may 2016

What programming should I make to do it this way?

date time pycharm python

2022-09-21 23:08

1 Answers

You can do it by referring to the two links below.

Official document regarding datetime

https://docs.python.org/ko/3/library/datetime.html

Formatting String

https://docs.python.org/ko/3/tutorial/inputoutput.html


2022-09-21 23:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.