Skip to content

Instantly share code, notes, and snippets.

@simecek
Created July 21, 2023 12:22
Show Gist options
  • Save simecek/4c94f235224c4de52a60b529a073ee70 to your computer and use it in GitHub Desktop.
Save simecek/4c94f235224c4de52a60b529a073ee70 to your computer and use it in GitHub Desktop.
EP_Day1_LT.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyNQSiLEAijhDToiiPIyuprV",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/simecek/4c94f235224c4de52a60b529a073ee70/ep_day1_lt.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"id": "VekIPMuiYrQo"
},
"outputs": [],
"source": [
"lookup = {\n",
" 'cz': 'Czechia',\n",
" 'de': 'Germany',\n",
" 'fi': 'Finland'\n",
"}\n",
"\n",
"result = [x for (x, lookup[x]) in ['ab', 'bc', 'cd', 'de'] if x in lookup]"
]
},
{
"cell_type": "code",
"source": [
"result"
],
"metadata": {
"id": "RyOn--ylZM9P"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"lookup"
],
"metadata": {
"id": "Tt15LJIFZZSL"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "OsuFqz9eZa68"
},
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment