Skip to content

Instantly share code, notes, and snippets.

@masasa27
Created May 23, 2020 16:09
Show Gist options
  • Save masasa27/91c7263cfcf22aae8a6fac30a92090c5 to your computer and use it in GitHub Desktop.
Save masasa27/91c7263cfcf22aae8a6fac30a92090c5 to your computer and use it in GitHub Desktop.
gists2.ipynb
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"first_dict = {'key1': 'hello', 'key2': 'world'}\n",
"second_dict = {'key3': 'whats', 'key4': 'up'}"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'key1': 'hello', 'key2': 'world', 'key3': 'whats', 'key4': 'up'}"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# joins the dicts\n",
"combined_dict = {**first_dict, **second_dict}\n",
"combined_dict"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"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.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment