Skip to content

Commit accaef2

Browse files
committed
true false ipython notebook
1 parent 212453a commit accaef2

1 file changed

Lines changed: 19 additions & 11 deletions

File tree

python_true_false.ipynb

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,23 @@
9797
],
9898
"language": "python",
9999
"metadata": {},
100-
"outputs": []
100+
"outputs": [
101+
{
102+
"output_type": "stream",
103+
"stream": "stdout",
104+
"text": [
105+
"my_true_val == True: True\n",
106+
"my_true_val is True: True\n",
107+
"my_true_val == None: False\n",
108+
"my_true_val is None: False\n",
109+
"my_true_val == False: False\n",
110+
"my_true_val is False: False\n",
111+
"\"if my_true_val:\" is True\n",
112+
"\"if not my_true_val:\" is False\n"
113+
]
114+
}
115+
],
116+
"prompt_number": 83
101117
},
102118
{
103119
"cell_type": "markdown",
@@ -264,7 +280,7 @@
264280
"metadata": {},
265281
"source": [
266282
"## Empty List\n",
267-
"It is generally not a good idea to use the `==` to check for empty lists. "
283+
"It is generally not a good idea to use the `==` to check for empty lists..."
268284
]
269285
},
270286
{
@@ -378,7 +394,7 @@
378394
"## List comparison \n",
379395
"List comparisons are a handy way to show the difference between `==` and `is`. \n",
380396
"While `==` is rather evaluating the equality of the value, `is` is checking if two objects are equal.\n",
381-
"The examples below show that we can assign a pointer to the same list object by using `=`, e.g., `list1 = list2`. If we want to make a copy of the list values, we have to make a little "
397+
"The examples below show that we can assign a pointer to the same list object by using `=`, e.g., `list1 = list2`. If we want to make a copy of the list values, we have to make a little tweak: `list1 = list2[:]`"
382398
]
383399
},
384400
{
@@ -416,14 +432,6 @@
416432
}
417433
],
418434
"prompt_number": 82
419-
},
420-
{
421-
"cell_type": "code",
422-
"collapsed": false,
423-
"input": [],
424-
"language": "python",
425-
"metadata": {},
426-
"outputs": []
427435
}
428436
],
429437
"metadata": {}

0 commit comments

Comments
 (0)