SHARE
TWEET

Untitled

a guest Mar 21st, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2.  "cells": [
  3.   {
  4.    "cell_type": "code",
  5.    "execution_count": 12,
  6.    "metadata": {},
  7.    "outputs": [
  8.     {
  9.      "name": "stdout",
  10.      "output_type": "stream",
  11.      "text": [
  12.       "{'a': 0, 'b': 1}\n",
  13.       "{'a': 2, 'b': 1}\n"
  14.      ]
  15.     }
  16.    ],
  17.    "source": [
  18.     "d ={}\n",
  19.     "d['a'] = d.get('a', 0)\n",
  20.     "d['b'] = d.get('b', 1)\n",
  21.     "print(d)\n",
  22.     "d['a'] = d.get('a', 0) + 2\n",
  23.     "print(d)"
  24.    ]
  25.   },
  26.   {
  27.    "cell_type": "code",
  28.    "execution_count": null,
  29.    "metadata": {},
  30.    "outputs": [],
  31.    "source": []
  32.   }
  33.  ],
  34.  "metadata": {
  35.   "kernelspec": {
  36.    "display_name": "Python 3",
  37.    "language": "python",
  38.    "name": "python3"
  39.   },
  40.   "language_info": {
  41.    "codemirror_mode": {
  42.     "name": "ipython",
  43.     "version": 3
  44.    },
  45.    "file_extension": ".py",
  46.    "mimetype": "text/x-python",
  47.    "name": "python",
  48.    "nbconvert_exporter": "python",
  49.    "pygments_lexer": "ipython3",
  50.    "version": "3.6.5"
  51.   }
  52.  },
  53.  "nbformat": 4,
  54.  "nbformat_minor": 2
  55. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top