{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Tutorial A2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__1__ Consider the equation $y = \\frac{3a + 2b}{b^2}$, with $a = 1$ and $b = 2$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - Calculate $y$ using Python." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - Of what type is the result?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - How can you force the result to be a whole number?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - Of what type is the result if $b = 1$?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " - What happens if $b = 0$?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__2__ Calculate the gravitational force between the moon and the earth at a distance of $r = 3.84\\times 10^8$ m, with masses $m_\\mathrm{earth} = 5.97\\times 10^{24}$ kg, $m_\\mathrm{moon} = 7.35\\times 10^{22}$ kg. Use $G = 6.67 \\times 10^{-11}$ m$^3$ kg$^{-1}$ s$^{-2}$ for the gravitational constant." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "__Advanced 1__ How does Python handle infinity and absent numeric values? What is\n", "the result of a multiplication of these values with 0?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "**Note:** Advanced exercises are not mandatory to get the points.\n", "\n", "
" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.10" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }