Skip to content

Herazur/bmiCalculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Your Life in Weeks

Instructions

I was reading this article by Tim Urban - Your Life in Weeks and realised just how little time we actually have.

https://waitbutwhy.com/2014/05/life-weeks.html

Create a program using maths and f-Strings that tells us how many days, weeks, months we have left if we live until 90 years old.

It will take your current age as the input and output a message with our time left in this format:

You have x days, y weeks, and z months left.

Where x, y and z are replaced with the actual calculated numbers.

Warning your output should match the Example Output format exactly, even the positions of the commas and full stops.

Example Input

56

Example Output

You have 12410 days, 1768 weeks, and 408 months left.

e.g. When you hit run, this is what should happen:

Hint

  1. There are 365 days in a year, 52 weeks in a year and 12 months in a year.
  2. Try copying the example output into your code and replace the relevant parts so that the sentence is formated the same way.

Test Your Code

Before checking the solution, try copy-pasting your code into this repl:

https://repl.it/@appbrewery/day-2-3-test-your-code

This repl includes my testing code that will check if your code meets this assignment's objectives.

Solution

https://repl.it/@appbrewery/day-2-3-solution

Releases

No releases published

Packages

No packages published

Languages