Skip to content

Instantly share code, notes, and snippets.

@re4lfl0w
Created June 14, 2014 10:58
Show Gist options
  • Save re4lfl0w/59f77574c7cd3cf4ecf0 to your computer and use it in GitHub Desktop.
Save re4lfl0w/59f77574c7cd3cf4ecf0 to your computer and use it in GitHub Desktop.
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# [Python challenge 0](http://www.pythonchallenge.com/pc/def/274877906944)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# Do you know binary compute?\n",
"2 ** 38"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 34,
"text": [
"274877906944"
]
}
],
"prompt_number": 34
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"http://www.pythonchallenge.com/pc/def/274877906944.html"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"# [Python challenge 1](http://www.pythonchallenge.com/pc/def/map.html)\n",
"\n",
"- K -> M\n",
"- O -> Q\n",
"- E -> G"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Question so far?"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"## Fragment2"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"## Fragment3"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"## Fragment4"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"## Fragment5"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import string\n",
"\n",
"result = []\n",
"for char in encrypt:\n",
" if char in string.ascii_lowercase:\n",
" if char == 'y':\n",
" char = 'a'\n",
" result.append(char)\n",
" elif char == 'z':\n",
" char = 'b'\n",
" result.append(char)\n",
" else:\n",
" result.append( chr( ord(char) + 2) )\n",
" else:\n",
" result.append(char)\n",
"print ''.join(result)"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url.\n"
]
}
],
"prompt_number": 81
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# sub-slide1"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": []
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"# sub-slide2"
],
"language": "python",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "subslide"
}
},
"source": [
"# sub-slide3"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"### Framgment1"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "fragment"
}
},
"source": [
"### Fragment2"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"### Slide"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "notes"
}
},
"source": [
"### Notes"
]
},
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"## Slide"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## -??"
]
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment