Question: using python: Number of years and months Use input to prompt for this integer value: total number of months Calculate these integer values: number of
using python:
Number of years and months
Use input to prompt for this integer value:
- total number of months
Calculate these integer values:
- number of years
- number of months
Display results as
{total number of months} months is {number of years} year(s) and {number of months} month(s). where values in {} are calculated values
Tests
| Input Months | Output |
| 18 | 18 months is 1 year(s) and 6 month(s) |
| 193 | 193 months is 16 year(s) and 1 month(s) |
Be sure to separate input from calculation from output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
