Skip to content

Instantly share code, notes, and snippets.

View bensk's full-sized avatar

Ben Samuels-Kalow bensk

View GitHub Profile
list_dictionaries = {
'monday':['grocery shopping'],
'i': [1, 3, 4],
'am': [1, 2, 3, 4]
}
print list_dictionaries
# What type of data is list_dictionaries?
# What type of data are list_dictionaries keys?
# What type of data are list_dictionaries values??
# Update the value of 'am' to [1, 2, 3, 4, 5]
@bensk
bensk / .bash_profile
Created May 15, 2016 19:14
.bash_profile
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# Get the Git branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
@bensk
bensk / Debugging While Loops.py
Created April 1, 2016 01:19
Debugging While Loops.py
# For each example below, predict what will be printed. Then, run the code and confirm your prediction.
a = 0
while a< 100:
print a
"""
Prediction:
Observation:
"""
@bensk
bensk / CSNYC Pedagogy Presentation.md
Last active March 14, 2016 01:40
CSNYC Pedagogy Presentation

CSNYC Pedagogy Presentation


Todo

  • Pictures of classroom (Have teachers draw their own rooms. Where this work happens is important.)
  • Slides
  • Demo groupings
  • Worksheets
# Khan Academy CS Musings
[Guide](https://www.khanacademy.org/coach-res/reference-for-coaches/teaching-computing/a/programming-curriculum-overview) is **fantastic**. Good writing.
When I click "Intro" is there any reason to jump me to a list, instead of straight into the work? There's a lot of words between me and coding.
Copy is nice and big, interstitials to code > Codecademy
What's the rationale for showing questions before i might actually have one?
numbers = [1,2,3]
for x in numbers:
print "We're on number %d" % (x)
grades = raw_input("What are your grades?").split() # Start out just like our old GPA calculator.
float_grades=[] # Make an empty list. We'll need this once we convert all of our grades to floats.
for inputs in grades: # This for loop will go through every grade...
num_grade = float(inputs) # float() the value of each grade...
float_grades.append(num_grade) # and append that float value to our empty list
# I've made a new variable. You don't NEED to do this, but it makes the last line look cleaner
average = sum(float_grades)/len(float_grades)
print "The _______ of Romeo & _______"
print ".............................."
def madLibs():
plural_noun = raw_input("plural noun".upper()).upper()
plural_noun1 = raw_input("Another plural noun".upper()).upper()
place = raw_input("place".upper()).upper()
noun = raw_input("noun".upper()).upper()
noun1 = raw_input("Another noun".upper()).upper()
adjective = raw_input("adjective".upper()).upper()