Added Example in Classes

pull/1/head
cif2cif 8 years ago
parent fdb3746c51
commit 034d3fe808

@ -46,7 +46,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {
"collapsed": false
},
@ -67,11 +67,29 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"<__main__.TV_Set object at 0x7fec69171860> off\n"
]
},
{
"data": {
"text/plain": [
"__main__.TV_Set"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"#Example object instantiation\n",
"\n",
@ -80,6 +98,27 @@
"type(my_tv)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Samsung on\n"
]
}
],
"source": [
"# Call on method\n",
"my_tv.on()\n",
"print(my_tv.name, my_tv.status)"
]
},
{
"cell_type": "markdown",
"metadata": {},

Loading…
Cancel
Save