Skip to content

Instantly share code, notes, and snippets.

#Setting up to use Glass ##Some links to help get set up:

Glass - api git clone: Along with other git links, I couldn't/didn't know how to use the link provided, I usually get the http link, which is what I did for all other github references. I went to the page and just copied and git cloned.

///We have an array of objects representing different people in our contacts lists.
//A lookUp function that takes firstName and a property (prop) as arguments has been pre-written for you.
//The function should check if firstName is an actual contact's firstName and the given property (prop) is a property of that contact.
//If both are true, then return the "value" of that property.
//If firstName does not correspond to any contacts then return "No such contact"
# Write a function that takes in a string and returns the number of
# letters that appear more than once in the string.
# The string will contain only lowercase letters. Count the number of
# letters that repeat, not the number of times they repeat in the
# string.
# Difficulty: hard.
def num_repeats(string):
common = dict()
def most_common_letter(string):
common = dict()
letters = list()
for letter in string:
letters.append(letter)
for x in letters:
common[x] = common.get(x,0) + 1
maxkey = None
maxval = None