SHARE
TWEET

Untitled

a guest May 16th, 2019 86 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": 1,
  6.    "metadata": {
  7.     "ExecuteTime": {
  8.      "end_time": "2019-05-06T03:06:17.541824Z",
  9.      "start_time": "2019-05-06T03:06:17.527884Z"
  10.     }
  11.    },
  12.    "outputs": [
  13.     {
  14.      "name": "stdout",
  15.      "output_type": "stream",
  16.      "text": [
  17.       "**********************************************************************\n",
  18.       "File \"__main__\", line 7, in __main__.isEven\n",
  19.       "Failed example:\n",
  20.       "    isEven(7)\n",
  21.       "Expected:\n",
  22.       "    True\n",
  23.       "Got:\n",
  24.       "    False\n",
  25.       "**********************************************************************\n",
  26.       "1 items had failures:\n",
  27.       "   1 of   3 in __main__.isEven\n",
  28.       "***Test Failed*** 1 failures.\n"
  29.      ]
  30.     }
  31.    ],
  32.    "source": [
  33.     "def isEven(num):\n",
  34.     "    '''Check if the pass in number is even.\n",
  35.     "    >>> isEven(0)\n",
  36.     "    True\n",
  37.     "    >>> isEven(777)\n",
  38.     "    False\n",
  39.     "    >>> isEven(7)\n",
  40.     "    True\n",
  41.     "    '''\n",
  42.     "    if num % 2 == 0:\n",
  43.     "        return True\n",
  44.     "    else:\n",
  45.     "        return False\n",
  46.     "    \n",
  47.     "if __name__ == \"__main__\":\n",
  48.     "    import doctest\n",
  49.     "    doctest.testmod()"
  50.    ]
  51.   }
  52.  ],
  53.  "metadata": {
  54.   "kernelspec": {
  55.    "display_name": "Python 3",
  56.    "language": "python",
  57.    "name": "python3"
  58.   },
  59.   "language_info": {
  60.    "codemirror_mode": {
  61.     "name": "ipython",
  62.     "version": 3
  63.    },
  64.    "file_extension": ".py",
  65.    "mimetype": "text/x-python",
  66.    "name": "python",
  67.    "nbconvert_exporter": "python",
  68.    "pygments_lexer": "ipython3",
  69.    "version": "3.7.0"
  70.   },
  71.   "varInspector": {
  72.    "cols": {
  73.     "lenName": 16,
  74.     "lenType": 16,
  75.     "lenVar": 40
  76.    },
  77.    "kernels_config": {
  78.     "python": {
  79.      "delete_cmd_postfix": "",
  80.      "delete_cmd_prefix": "del ",
  81.      "library": "var_list.py",
  82.      "varRefreshCmd": "print(var_dic_list())"
  83.     },
  84.     "r": {
  85.      "delete_cmd_postfix": ") ",
  86.      "delete_cmd_prefix": "rm(",
  87.      "library": "var_list.r",
  88.      "varRefreshCmd": "cat(var_dic_list()) "
  89.     }
  90.    },
  91.    "types_to_exclude": [
  92.     "module",
  93.     "function",
  94.     "builtin_function_or_method",
  95.     "instance",
  96.     "_Feature"
  97.    ],
  98.    "window_display": false
  99.   }
  100.  },
  101.  "nbformat": 4,
  102.  "nbformat_minor": 2
  103. }
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