""" Exercise 1.3 from "A primer on..." Solved in lecture Thursday 22/8 Can a newborn baby expect to live 1 billion seconds? To answer the question we simply convert seconds to years and write out the answer. We do the conversion step by step to illustrate the use of variables and assignments, and use an f-string to format the output. For details on f-string formatting, see page 11 of the book "Introduction to scientific programming with Python". """ seconds = 1e9 minutes = seconds / 60 hours = minutes / 60 days = hours / 24 years = days / 365.25 print(f'{seconds:g} seconds is {years:.1f} years') """ Usage and output: Terminal> python seconds2years.py 1e+09 seconds is 31.7 years """