{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'date_of_death': datetime.datetime(2070, 10, 16, 0, 0),\n",
      " 'days_lived': 10411,\n",
      " 'years_left': 49.47397260273973}\n"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "import pprint\n",
    "\n",
    "birthday = datetime.datetime.strptime(\"04.11.1992\", \"%d.%m.%Y\")\n",
    "point_in_time = datetime.datetime.now()\n",
    "life_expectancy = 78\n",
    "time_change = datetime.timedelta(hours=24*365*life_expectancy)\n",
    "result = {}\n",
    "result['date_of_death'] = birthday + time_change\n",
    "result['days_lived'] = (point_in_time - birthday).days\n",
    "result['years_left'] = (result['date_of_death'] - point_in_time ).days / 365\n",
    "\n",
    "\n",
    "pprint.pprint(result)\n",
    "\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
