{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Lab 3\n", "In the following cell you have several lists. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#list of 007 movies where Sean Connery features James Bond\n", "moviesSeanConnery = [\"Dr. No (1962)\",\n", "\"From Russia with Love (1963)\",\n", "\"Goldfinger (1964)\",\n", "\"Thunderball (1965)\",\n", "\"You Only Live Twice (1967)\",\n", "\"Diamonds Are Forever (1971)\", \n", "\"Never Say Never Again (1983)\"] \n", "\n", "#list of 007 movies where David Neven features James Bond\n", "moviesDavidNeven=[\"Casino Royale (1967)\"] \n", "\n", "#list of 007 movies where George Lazenby features James Bond\n", "moviesGeorgeLazenby=[\"On Her Majesty's Secret Service (1969)\"] \n", " \n", "#list of 007 movies where Roger Moore features James Bond \n", "moviesRogerMoore=[ \"Live and Let Die (1973)\",\n", "\"The Man with the Golden Gun (1974)\",\n", "\"The Spy Who Loved Me (1977)\",\n", "\"Moonraker (1979)\",\n", "\"For Your Eyes Only (1981)\",\n", "\"Octopussy (1983)\",\n", "\"A View to a Kill (1985)\"]\n", "\n", "#list of 007 movies where Timothy Dalton features James Bond \n", "moviesTimothyDalton=[\n", "\"The Living Daylights (1987)\",\n", "\"Licence to Kill (1989)\" \n", "]\n", "\n", "#list of 007 movies where Pierce Brosnan features James Bond \n", "moviesPierceBrosnan=[\n", "\"GoldenEye (1995)\",\n", "\"Tomorrow Never Dies (1997)\",\n", "\"The World Is Not Enough (1999)\",\n", "\"Die Another Day (2002)\"\n", "]\n", "\n", "#list of 007 movies where Daniel Craig features James Bond \n", "moviesDanielCraig=[\"Casino Royale (2006)\",\n", "\"Quantum of Solace (2008)\",\n", "\"Skyfall (2012)\",\n", "\"Spectre (2015)\"]\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**1)** Create a list of lists (movies007). The list will be composed by each list of movies featured by each actor." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**2)** How many movies were played by the first actor to play James Bond?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**3)** How many movies were played by the last actor to play James Bond?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**4)** How many actors played the role of James Bond?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**5)** Create a new list with the number of movies played by each actor" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**6)** How many movies were played by the actor who appeared most often in movies?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**7)** How many movies were played by the actor who appeared in fewer movies?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**8)** Create a new list (movies007a) with all the films. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**9)** Sort the elements of the list " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**9)** Reverse the order of the list. What will happen if this method is executed twice? Does this method sort the list if it is not sorted?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**10)** What is the index of the movie \"Spectre (2015)\" in the list of movies" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**11)** Add the movie \"007 and the bad Guy of the climate change (2020)\" in the 11th position." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**12)** It was a mistake. Remove the movie \"007 and the bad Guy of the climate change (2020)\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.7" } }, "nbformat": 4, "nbformat_minor": 2 }