Skip to content

Instantly share code, notes, and snippets.

@j-greer
Last active Feb 10, 2016
Embed
What would you like to do?
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"##Toy Example of Python Module\n",
"\n",
"#Variable definitions\n",
"A = 'A'\n",
"Z = 'Z'\n",
"\n",
"#Function Definitions\n",
"def check_if_letter(letter): #Check if character passed to function is a letter\n",
" return letter.isalpha()\n",
"\n",
"def lower_case(letter): #Return lower-case letter\n",
" return word.lower()\n",
"\n",
"def position(letter): #Ordinal position of letter in the alphabet\n",
" return ord(letter) - 96"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.10"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment