5. Conversion Language: Python 3 G Autocomplete Ready O 1 > #Assume there are 30 days in each month -.. The program takes number of days as input, and converts it into years, months, weeks and days. Assume that each month is 30 days long for the calculations. 4 5 # Enter your code here 7 vif _name_ == " _main__": Function Description You have to create the following functions: main() 1. get yr mth wk day takes one argument: total days, converts it in the number of years, months, weeks and days, and prints the output as specified in the output sample. If the number of years is 1, make sure it prints "year" and not "years", and same applies for months, weeks and days as well. 2. main program should input a number from the user (days), and check if the number is a positive integer or not. If not, it should print a message stating: "Input can be a positive integer only. Try Again!" and continue until the correct input is received. Once the input received is correct, make sure the error checking for 0 or negative numbers is taken care of according to the output samples. If all is fine, then it should call the get yr_mth wk_day function to print the division of days as per the requirement. Constraints • days >0 > Input Format For Custom Testing v Sample Case 0 Sample Input For Custom Testing 415 Sample Output There are: 1 year, 1 month, 2 weeks and 6 days in 415 total days. Explanation Divides the total days in years, months, weeks and days and prints the output Test Custom Run Code
5. Conversion Language: Python 3 G Autocomplete Ready O 1 > #Assume there are 30 days in each month -.. The program takes number of days as input, and converts it into years, months, weeks and days. Assume that each month is 30 days long for the calculations. 4 5 # Enter your code here 7 vif _name_ == " _main__": Function Description You have to create the following functions: main() 1. get yr mth wk day takes one argument: total days, converts it in the number of years, months, weeks and days, and prints the output as specified in the output sample. If the number of years is 1, make sure it prints "year" and not "years", and same applies for months, weeks and days as well. 2. main program should input a number from the user (days), and check if the number is a positive integer or not. If not, it should print a message stating: "Input can be a positive integer only. Try Again!" and continue until the correct input is received. Once the input received is correct, make sure the error checking for 0 or negative numbers is taken care of according to the output samples. If all is fine, then it should call the get yr_mth wk_day function to print the division of days as per the requirement. Constraints • days >0 > Input Format For Custom Testing v Sample Case 0 Sample Input For Custom Testing 415 Sample Output There are: 1 year, 1 month, 2 weeks and 6 days in 415 total days. Explanation Divides the total days in years, months, weeks and days and prints the output Test Custom Run Code
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Python3 code required!
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education