{ "nbformat_minor": 2, "nbformat": 4, "cells": [ { "source": [ "$$\n", "\\def\\CC{\\bf C}\n", "\\def\\QQ{\\bf Q}\n", "\\def\\RR{\\bf R}\n", "\\def\\ZZ{\\bf Z}\n", "\\def\\NN{\\bf N}\n", "$$\n", "# Lists\n", "\n", "## Exercise 1\n", "\n", "Define the three list `A=['Monday', 'Tuesday']`, `B=['Wednesday', 'Thursday']` and `C=['Friday', 'Saturday', 'Sunday']` :" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Using `A`, `B` and `C`, construct the list of seven days of the week in which we removed Wednesday:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Construct the week of the four Thursdays:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Construct the list of working days of the week:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "Sort the previous list in decreasing lexicographic order:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "## Exercise 2\n", "\n", "Construct the list of squares and the list of all cubes of all numbers from 20 to 40:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "## Exercise 3\n", "\n", "Construct the list of powers of 5 for all values of exponents in the interval $[6,14]$ :" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "## Exercise 4\n", "\n", "Construct the list of sinus of angles from 0 to 90 degrees by step of 5 degrees:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "## Exercise 5\n", "\n", "Here is a list describing the size of 64 files:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "L = [\"12K\", \"12K\", \"12K\", \"12K\", \"12K\", \"12K\", \"12K\", \"12K\", \"16K\",\n", "\"16K\", \"16K\", \"20K\", \"20K\", \"20K\", \"24K\", \"24K\", \"24K\", \"24K\", \"24K\",\n", "\"24K\", \"24K\", \"24K\", \"24K\", \"28K\", \"32K\", \"40K\", \"4K\", \"4K\", \"4K\", \"4K\",\n", "\"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\",\n", "\"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\", \"4K\",\n", "\"4K\", \"4K\", \"4K\", \"4K\", \"8K\", \"8K\", \"8K\", \"8K\", \"8K\", \"8K\"] " ], "outputs": [], "metadata": {} }, { "source": [ "Compute the total size of the files, their average and the median:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} }, { "source": [ "How many files are there of each size?:" ], "cell_type": "markdown", "metadata": {} }, { "execution_count": null, "cell_type": "code", "source": [ "# edit here" ], "outputs": [], "metadata": {} } ], "metadata": { "kernelspec": { "display_name": "sagemath", "name": "sagemath" } } }