{ "metadata": { "name": "chapter2" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Chapter 2 - Memory & Data Types" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 2.1, page no. 54" ] }, { "cell_type": "code", "collapsed": false, "input": [ "\"\"\"\n", "Data Types\n", "Note: there is no long double, or float double or double range or short.\n", "Also, the size of data types my differ compared to c++\n", "\"\"\"\n", "\n", "import sys \n", "\n", "print \"Size of Integer is: \" + str(sys.getsizeof(int()))\n", "print \"Size of Float is: \" + str(sys.getsizeof(float()))\n", "print \"Size of Long is: \" + str(sys.getsizeof(long()))\n", "print \"Size of String is: \" + str(sys.getsizeof(str()))" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Size of Integer is: 24\n", "Size of Float is: 24\n", "Size of Long is: 24\n", "Size of String is: 37\n" ] } ], "prompt_number": 1 } ], "metadata": {} } ] }