diff options
author | kinitrupti | 2017-05-12 18:53:46 +0530 |
---|---|---|
committer | kinitrupti | 2017-05-12 18:53:46 +0530 |
commit | 6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d (patch) | |
tree | 22789c9dbe468dae6697dcd12d8e97de4bcf94a2 /Programming_in_C_by_Stephen_G._Kochan/Chapter_19.ipynb | |
parent | d36fc3b8f88cc3108ffff6151e376b619b9abb01 (diff) | |
download | Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.gz Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.tar.bz2 Python-Textbook-Companions-6279fa19ac6e2a4087df2e6fe985430ecc2c2d5d.zip |
Removed duplicates
Diffstat (limited to 'Programming_in_C_by_Stephen_G._Kochan/Chapter_19.ipynb')
-rwxr-xr-x | Programming_in_C_by_Stephen_G._Kochan/Chapter_19.ipynb | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/Programming_in_C_by_Stephen_G._Kochan/Chapter_19.ipynb b/Programming_in_C_by_Stephen_G._Kochan/Chapter_19.ipynb new file mode 100755 index 00000000..731d6d87 --- /dev/null +++ b/Programming_in_C_by_Stephen_G._Kochan/Chapter_19.ipynb @@ -0,0 +1,65 @@ +{ + "metadata": { + "name": "Chapter XIX" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 19: Object-oriented programming" + ] + }, + { + "cell_type": "heading", + "level": 3, + "metadata": {}, + "source": [ + "Program 19.1, Page number: 414" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "\n", + "class Fraction:\n", + " def __init__(self): #Class constructor\n", + " self.numerator=0\n", + " self.denominator=0\n", + "\n", + "def main():\n", + "\n", + " #Creating instance\n", + " myFract=Fraction()\n", + " myFract.numerator=1\n", + " myFract.denominator=3\n", + "\n", + " print(\"The Fraction is {0}/{1}\".format(myFract.numerator,myFract.denominator))\n", + "\n", + "if __name__=='__main__':\n", + " main()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Fraction is 1/3\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file |