Python Jumpstart by Building 10 Apps Transcripts
Chapter: App 3: Birthday countdown app
Lecture: Birthday countdown app
0:00 It's time for app number 3, this time we are going to write an app that'll answer the question how long until your birthday.
0:08 So what exactly are we going to build? We are going to build an app that looks like this it's going to have a little header
0:13 saying birthday app like all of our apps do, and then it's going to first ask a couple of questions of the user when were they born,
0:21 so ask the year, month and day, and then pull those back, those will come back as strings, we'll convert those to numbers,
0:28 and use those numbers to actually come up with a date object, that represents a particular time on the calendar,
0:35 and then we'll do a little math with that date, relative to today, and we'll use that to answer the question how long is it until your birthday
0:45 and if you have already had your birthday we'll say hey your birthday was so many days ago. So again, that looks pretty straightforward,
0:51 but we are going to learn a lot. We are going to come back to working with functions
0:57 and organizing our code into small, reusable pieces of functionality and in our previous example, we saw that we worked with functions
1:04 but they were sort of the most basic, they were just things you would call to have actions and here we are going to have functions
1:11 that both take parameters and so we can supply different values to them like a particular date and the return values,
1:18 the things like how many days from this particular date until now. The other major thing we'll focus on is dates and times and time spans,
1:28 so when you work with dates and times between dates, in Python these are the 3 basic concepts that you'll see and they will be central to this app.