From 9adcba6aef09dcc3d1282277c87bd64793009ee5 Mon Sep 17 00:00:00 2001 From: Axel Barck-Holst <102673853+AxelHolst@users.noreply.github.com> Date: Mon, 8 Jul 2024 15:47:36 +0200 Subject: [PATCH] Add Frida Kahlo Retrospective Off-Platform Project --- .../frida_project-checkpoint.ipynb | 190 ++++++++++++++ .../frida_solution-checkpoint.ipynb | 248 ++++++++++++++++++ fridakahlo/frida_project.ipynb | 239 +++++++++++++++++ 3 files changed, 677 insertions(+) create mode 100644 fridakahlo/.ipynb_checkpoints/frida_project-checkpoint.ipynb create mode 100644 fridakahlo/.ipynb_checkpoints/frida_solution-checkpoint.ipynb create mode 100644 fridakahlo/frida_project.ipynb diff --git a/fridakahlo/.ipynb_checkpoints/frida_project-checkpoint.ipynb b/fridakahlo/.ipynb_checkpoints/frida_project-checkpoint.ipynb new file mode 100644 index 0000000..1a22509 --- /dev/null +++ b/fridakahlo/.ipynb_checkpoints/frida_project-checkpoint.ipynb @@ -0,0 +1,190 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Frida Kahlo Exhibition\n", + "\n", + "You've been hired to work on a retrospective of Frida Kahlo's work at a major museum. You're job is to put together the audio tour, but in order to do that you need to create a list of each painting featured in the exhibit, the date it was painted, and its spot in the tour. \n", + "\n", + "Use your knowledge of Python lists to create a master list of each painting, its date, and its audio tour ID. \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 1\n", + "First, create a list called `paintings` and add the following titles to it:\n", + "\n", + "`The Two Fridas, My Dress Hangs Here, Tree of Hope, Self Portrait With Monkeys`\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 2\n", + "\n", + "Next, create a second list called `dates` and give it the following values:\n", + "`1939, 1933, 1946, 1940`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 3 \n", + "It doesn't do much good to have the paintings without their dates, and vice versa. \n", + "Zip together the two lists so that each painting is paired with its date and resave it to the `paintings` variable. Make sure to convert the zipped object into a list using the `list()` function. Print the results to the terminal to check your work. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 4\n", + "There were some last minute additions to the show that we need to add to our list. Append the following paintings to our `paintings` list then re-print to check they were added correctly:\n", + "- 'The Broken Column', 1944\n", + "- 'The Wounded Deer', 1946\n", + "- 'Me and My Doll', 1937\n", + "\n", + "Hint: Make sure to append each painting individually and that you're appending them as tuples, not lists. " + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 5\n", + "Since each of these paintings is going to be in the audio tour, they each need a unique identification number.\n", + "But before we assign them a number, we first need to check how many paintings there are in total.\n", + "\n", + "Find the length of the `paintings` list." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 6\n", + "Use the `range` method to generate a list of identification numbers that starts at 1 and is equal in length to our list of items. \n", + "Save the list to the variable `audio_tour_number` and check your work by printing the list." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 7 \n", + "\n", + "We're finally read to create our master list. \n", + "Zip the `audio_tour_number` list to the `paintings` list and save it as `master_list`.\n", + "\n", + "Hint: Make sure to convert the zipped object into a list using the `list()` function." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 8 \n", + "Print the `master_list` to the terminal." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "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.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/fridakahlo/.ipynb_checkpoints/frida_solution-checkpoint.ipynb b/fridakahlo/.ipynb_checkpoints/frida_solution-checkpoint.ipynb new file mode 100644 index 0000000..ba93f92 --- /dev/null +++ b/fridakahlo/.ipynb_checkpoints/frida_solution-checkpoint.ipynb @@ -0,0 +1,248 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Frida Kahlo Exhibition\n", + "\n", + "You've been hired to work on a retrospective of Frida Kahlo's work at a major museum. You're job is to put together the audio tour, but in order to do that you need to create a list of each painting featured in the exhibit, the date it was painted, and its spot in the tour. \n", + "\n", + "Use your knowledge of Python lists to create a master list of each painting, its date, and its audio tour ID. \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 1\n", + "First, create a list called `paintings` and add the following titles to it:\n", + "\n", + "`The Two Fridas, My Dress Hangs Here, Tree of Hope, Self Portrait With Monkeys`\n" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "paintings = ['The Two Fridas', 'My Dress Hangs Here', 'Tree of Hope', 'Self Portrait With Monkeys']" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 2\n", + "\n", + "Next, create a second list called `dates` and give it the following values:\n", + "`1939, 1933, 1946, 1940`" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "dates = [1939, 1933, 1946, 1940]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 3 \n", + "It doesn't do much good to have the paintings without their dates, and vice versa. \n", + "Zip together the two lists so that each painting is paired with its date and resave it to the `paintings` variable. Make sure to convert the zipped object into a list using the `list()` function. Print the results to the terminal to check your work. " + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[('The Two Fridas', 1939), ('My Dress Hangs Here', 1933), ('Tree of Hope', 1946), ('Self Portrait With Monkeys', 1940)]\n" + ] + } + ], + "source": [ + "paintings = list(zip(paintings, dates))\n", + "print (paintings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 4\n", + "There were some last minute additions to the show that we need to add to our list. Append the following paintings to our `paintings` list then re-print to check they were added correctly:\n", + "- 'The Broken Column', 1944\n", + "- 'The Wounded Deer', 1946\n", + "- 'Me and My Doll', 1937\n", + "\n", + "Hint: Make sure to append each painting individually and that you're appending them as tuples, not lists. " + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[('The Two Fridas', 1939), ('My Dress Hangs Here', 1933), ('Tree of Hope', 1946), ('Self Portrait With Monkeys', 1940), ('The Broken Column', 1944), ('The Wounded Deer', 1946), ('Me and My Doll', 1937)]\n" + ] + } + ], + "source": [ + "paintings.append(('The Broken Column', 1944))\n", + "paintings.append(('The Wounded Deer', 1946))\n", + "paintings.append(('Me and My Doll', 1937))\n", + " \n", + "print (paintings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 5\n", + "Since each of these paintings is going to be in the audio tour, they each need a unique identification number.\n", + "But before we assign them a number, we first need to check how many paintings there are in total.\n", + "\n", + "Find the length of the `paintings` list." + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "7" + ] + }, + "execution_count": 57, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(paintings)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 6\n", + "Use the `range` method to generate a list of identification numbers that starts at 1 and is equal in length to our list of items. \n", + "Save the list to the variable `audio_tour_number` and check your work by printing the list." + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 6, 7]\n" + ] + } + ], + "source": [ + "audio_tour_number = list(range(1, 8))\n", + "\n", + "print (audio_tour_number)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 7 \n", + "\n", + "We're finally read to create our master list. \n", + "Zip the `audio_tour_number` list to the `paintings` list and save it as `master_list`.\n", + "\n", + "Hint: Make sure to convert the zipped object into a list using the `list()` function." + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "master_list = list(zip(audio_tour_number, paintings))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 8 \n", + "Print the `master_list` to the terminal." + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[(1, ('The Two Fridas', 1939)), (2, ('My Dress Hangs Here', 1933)), (3, ('Tree of Hope', 1946)), (4, ('Self Portrait With Monkeys', 1940)), (5, ('The Broken Column', 1944)), (6, ('The Wounded Deer', 1946)), (7, ('Me and My Doll', 1937))]\n" + ] + } + ], + "source": [ + "print(master_list)" + ] + } + ], + "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.2" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/fridakahlo/frida_project.ipynb b/fridakahlo/frida_project.ipynb new file mode 100644 index 0000000..0a785aa --- /dev/null +++ b/fridakahlo/frida_project.ipynb @@ -0,0 +1,239 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Frida Kahlo Exhibition\n", + "\n", + "You've been hired to work on a retrospective of Frida Kahlo's work at a major museum. Your job is to put together the audio tour, but in order to do that you need to create a list of each painting featured in the exhibit, the date it was painted, and its spot in the tour. \n", + "\n", + "Use your knowledge of Python lists to create a master list of each painting, its date, and its audio tour ID. \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 1\n", + "First, create a list called `paintings` and add the following titles to it:\n", + "\n", + "`The Two Fridas, My Dress Hangs Here, Tree of Hope, Self Portrait With Monkeys`\n" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "paintings = ['The Two Fridas', 'My Dress Hangs Here', 'Tree of Hope', 'Self Portrait With Monkeys']\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 2\n", + "\n", + "Next, create a second list called `dates` and give it the following values:\n", + "`1939, 1933, 1946, 1940`" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "dates = [1939, 1933, 1946, 1940]\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 3 \n", + "It doesn't do much good to have the paintings without their dates, and vice versa. \n", + "Zip together the two lists so that each painting is paired with its date and resave it to the `paintings` variable. Make sure to convert the zipped object into a list using the `list()` function. Print the results to the terminal to check your work. " + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[('The Two Fridas', 1939), ('My Dress Hangs Here', 1933), ('Tree of Hope', 1946), ('Self Portrait With Monkeys', 1940)]\n" + ] + } + ], + "source": [ + "paintings = list(zip(paintings, dates))\n", + "print(paintings)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 4\n", + "There were some last minute additions to the show that we need to add to our list. Append the following paintings to our `paintings` list then re-print to check they were added correctly:\n", + "- 'The Broken Column', 1944\n", + "- 'The Wounded Deer', 1946\n", + "- 'Me and My Doll', 1937\n", + "\n", + "Hint: Make sure to append each painting individually and that you're appending them as tuples, not lists. " + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[('The Two Fridas', 1939), ('My Dress Hangs Here', 1933), ('Tree of Hope', 1946), ('Self Portrait With Monkeys', 1940), ('The Broken Column', 1944), ('The Wounded Deer', 1946), ('Me and My Doll', 1937)]\n" + ] + } + ], + "source": [ + "paintings.append(('The Broken Column', 1944))\n", + "paintings.append(('The Wounded Deer', 1946))\n", + "paintings.append(('Me and My Doll', 1937))\n", + "\n", + "print(paintings)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 5\n", + "Since each of these paintings is going to be in the audio tour, they each need a unique identification number.\n", + "But before we assign them a number, we first need to check how many paintings there are in total.\n", + "\n", + "Find the length of the `paintings` list." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "7" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(paintings)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 6\n", + "Use the `range` method to generate a list of identification numbers that starts at 1 and is equal in length to our list of items. \n", + "Save the list to the variable `audio_tour_number` and check your work by printing the list." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 6, 7]\n" + ] + } + ], + "source": [ + "audio_tour_number = list(range(1, 8))\n", + "print(audio_tour_number)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 7 \n", + "\n", + "We're finally read to create our master list. \n", + "Zip the `audio_tour_number` list to the `paintings` list and save it as `master_list`.\n", + "\n", + "Hint: Make sure to convert the zipped object into a list using the `list()` function." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "master_list = list(zip(audio_tour_number, paintings))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Task 8 \n", + "Print the `master_list` to the terminal." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[(1, ('The Two Fridas', 1939)), (2, ('My Dress Hangs Here', 1933)), (3, ('Tree of Hope', 1946)), (4, ('Self Portrait With Monkeys', 1940)), (5, ('The Broken Column', 1944)), (6, ('The Wounded Deer', 1946)), (7, ('Me and My Doll', 1937))]\n" + ] + } + ], + "source": [ + "print(master_list)" + ] + } + ], + "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.6" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +}