Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is for python 3. Thanks in advance 6) (10 points) Write a function, days alive_loop, that, given a year, month, and a day representing
This is for python 3. Thanks in advance
6) (10 points) Write a function, days alive_loop, that, given a year, month, and a day representing a birthday, returns the number of days that person has been alive. You may use your absolute_day (year, month number) function, and the provided get_year ) get month and get_day) functions as well as calendar isleap (yearl to solve this problem. You must solve this problem using a while loop! Function call daya alive loop(2019, 2. 25) days alive loop (2018, 2. 10 daya alive loop(2000, . 30) Retum value (assuming that the current day is February 26th, 2019) 381 6876 7) (5 points) Write a function, days alive math, that, given a year, month, and a day representing a birthday, returns the number of days that person has been alive. You may use your absolute day (year, month number) function, and the provided get year O get month ,and get_day functions as well as calendax Leapdaya (heain year end year to solve this problem. You must solve this problem without using a while loop Function cal days alive math(2039, 2, 25) daya-alive-mat h (2018, 2# 10) daya-alive-mat h (2000, 4# 30) Retum value (assuming that the current day is February 26th, 2019) 383 6876 8) (5 points) Finally, write a main function in which you repeatedly ask the user for birthdays and print the number of days they have been alive until they type "done" Function call Output (as suming that the current day is February 26th, 2019) main Year7 201 Month? 2 Day? 25 That 'a 2 days Year? 1800 Month? 1 Day?1 That's 80044 days Year? dons Month? done 6) (10 points) Write a function, days alive_loop, that, given a year, month, and a day representing a birthday, returns the number of days that person has been alive. You may use your absolute_day (year, month number) function, and the provided get_year ) get month and get_day) functions as well as calendar isleap (yearl to solve this problem. You must solve this problem using a while loop! Function call daya alive loop(2019, 2. 25) days alive loop (2018, 2. 10 daya alive loop(2000, . 30) Retum value (assuming that the current day is February 26th, 2019) 381 6876 7) (5 points) Write a function, days alive math, that, given a year, month, and a day representing a birthday, returns the number of days that person has been alive. You may use your absolute day (year, month number) function, and the provided get year O get month ,and get_day functions as well as calendax Leapdaya (heain year end year to solve this problem. You must solve this problem without using a while loop Function cal days alive math(2039, 2, 25) daya-alive-mat h (2018, 2# 10) daya-alive-mat h (2000, 4# 30) Retum value (assuming that the current day is February 26th, 2019) 383 6876 8) (5 points) Finally, write a main function in which you repeatedly ask the user for birthdays and print the number of days they have been alive until they type "done" Function call Output (as suming that the current day is February 26th, 2019) main Year7 201 Month? 2 Day? 25 That 'a 2 days Year? 1800 Month? 1 Day?1 That's 80044 days Year? dons Month? done Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started