\n", "

## Challenges

\n", "\n", "
\n", "
1. Convert the speed in imperial units (miles/hour) using:
\n", "\n", " ```from astropy.units import imperial```\n", "
2. \n", "
3. Calculate whether a pint is more than half litre
\n", " \n", " You can compare quantities as comparing variables.
\n", " Something strange? Check what deffinition of pint astropy is using.\n", "
4. \n", "
5. Does units work with areas? calculate the area of a rectangle of 3 km of side and 5 meter of width. Show them in m^2 and convert them to yards^2
6. \n", "
\n", "

## Challenges

\n", "\n", "
\n", "
1. Create a function that calculates potential energy where *g* defaults to Earth value, \n", " but could be used for different planets. \n", " Test it for any of the *g* values for any other \n", " planet.\n", "
2. \n", "
\n", "
" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": 36, "cell_type": "code", "source": [ "#4\n" ], "outputs": [], "metadata": { "collapsed": true } }, { "execution_count": 37, "cell_type": "code", "source": [ "# run it for some values\n" ], "outputs": [], "metadata": { "collapsed": false } }, { "execution_count": 38, "cell_type": "code", "source": [ "# on Mars:\n" ], "outputs": [], "metadata": { "collapsed": false } }, { "source": [ "## Create your own units\n", "\n", "Some times we want to create our own units:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": 39, "cell_type": "code", "source": [ "# Create units for a laugh scale\n" ], "outputs": [], "metadata": { "collapsed": false } }, { "source": [ "
\n", "

## Challenges

\n", "\n", "
\n", "
1. Convert the area calculated before `rectangle_area` in Hectare\n", " (1 hectare = 100 ares; 1 are = 100 m2).\n", "
2. \n", "
\n", "
" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": 40, "cell_type": "code", "source": [ "#5\n" ], "outputs": [], "metadata": { "collapsed": false } } ], "metadata": { "kernelspec": { "display_name": "Python 2", "name": "python2", "language": "python2" }, "language_info": { "mimetype": "text/x-python", "nbconvert_exporter": "python", "name": "python", "file_extension": ".py", "version": "2.7.11", "pygments_lexer": "ipython2", "codemirror_mode": { "version": 2, "name": "ipython" } } } }