pleabargain

Learn Python3 The Hard Way exe33 ipynb

Jun 2nd, 2013
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. {
  2.  "metadata": {
  3.   "name": "Learn Python3 The Hard Way exe33"
  4.  },
  5.  "nbformat": 3,
  6.  "nbformat_minor": 0,
  7.  "worksheets": [
  8.   {
  9.    "cells": [
  10.     {
  11.      "cell_type": "code",
  12.      "collapsed": false,
  13.      "input": "i = 0\n\nnumbers = []\n\nwhile i < 6:\n    print (\"at the top is {}\".format(i))\n    numbers.append(i)\n    \n    i=i +1\n    print (\"numbers now: \", numbers)\n    print (\"at the bottom i is {} \".format(i))\n    \nprint (\"The numbers: \")\n\nfor num in numbers:\n    print (num)\n\n\n\n\n\n\n\n\n",
  14.      "language": "python",
  15.      "metadata": {},
  16.      "outputs": [
  17.       {
  18.        "output_type": "stream",
  19.        "stream": "stdout",
  20.        "text": "at the top is 0\nnumbers now:  [0]\nat the bottom i is 1 \nat the top is 1\nnumbers now:  [0, 1]\nat the bottom i is 2 \nat the top is 2\nnumbers now:  [0, 1, 2]\nat the bottom i is 3 \nat the top is 3\nnumbers now:  [0, 1, 2, 3]\nat the bottom i is 4 \nat the top is 4\nnumbers now:  [0, 1, 2, 3, 4]\nat the bottom i is 5 \nat the top is 5\nnumbers now:  [0, 1, 2, 3, 4, 5]\nat the bottom i is 6 \nThe numbers: \n0\n1\n2\n3\n4\n5\n"
  21.       }
  22.      ],
  23.      "prompt_number": 1
  24.     }
  25.    ],
  26.    "metadata": {}
  27.   }
  28.  ]
  29. }
Add Comment
Please, Sign In to add comment