{ "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "from time import sleep\n", "\n", "x = 0.0\n", "\n", "while x != 1.0:\n", " x += 0.1\n", " print repr(x)\n", " \n", " sleep(0.1)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "0.1\n", "0.2" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.30000000000000004" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.4" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.5" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.6" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.7" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.7999999999999999" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.8999999999999999" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "0.9999999999999999" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.0999999999999999" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.2" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.3" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.4000000000000001" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.5000000000000002" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.6000000000000003" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.7000000000000004" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.8000000000000005" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "1.9000000000000006" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.0000000000000004" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.1000000000000005" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.2000000000000006" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.3000000000000007" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.400000000000001" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.500000000000001" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.600000000000001" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.700000000000001" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.800000000000001" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "2.9000000000000012" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "3.0000000000000013" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "3.1000000000000014" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "3.2000000000000015" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "3.3000000000000016" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "3.4000000000000017" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "3.5000000000000018" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "3.600000000000002" ] }, { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "pyerr", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0;32mprint\u001b[0m \u001b[0mrepr\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 9\u001b[0;31m \u001b[0msleep\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0.1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[0;31mKeyboardInterrupt\u001b[0m: " ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }