months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October']

# print(months[8])

# print(len(months))


list_of_random_things = [1, 3.4, 'a string', True]
# print(list_of_random_things[1:2])

eclipse_dates = ['June 21, 2001', 'December 4, 2002', 'November 23, 2003',
                 'March 29, 2006', 'August 1, 2008', 'July 22, 2009',
                 'July 11, 2010', 'November 13, 2012', 'March 20, 2015',
                 'March 9, 2016']

# print(eclipse_dates[-3:])

new_str = "-".join(["fore", "aft", "starboard", "port"])
# print(new_str)


tuple_a = 1, 2
tuple_b = (1, 2)

# print(tuple_a == tuple_b)
# print(tuple_a[1])


elements = {"hydrogen": 1, "helium": 2, "carbon": 6}
elements["lithium"]=3

# print(elements)

# print("carbon" in elements)

# print(elements.get("dilithium"))

population = {
    "Shanghai" : 17.8,
    "Istanbul" : 13.3,
    "Karachi" : 13.0,
    "Mumbai" : 12.5
}

# print(population["Delhi"])

a = [1, 2, 3]
b = a
c = [1, 2, 3]

# print(a == b)
# print(a is b)
# print(a == c)
# print(a is c)


animals = {'dogs': [20, 10, 15, 8, 32, 15], 'cats': [3,4,2,8,2,4], 'rabbits': [2, 3, 3], 'fish': [0.3, 0.5, 0.8, 0.3, 1]}
# print(animals.get('cats'))


elements = {"hydrogen": {"number": 1,
                         "weight": 1.00794,
                         "symbol": "H"},
              "helium": {"number": 2,
                         "weight": 4.002602,
                         "symbol": "He"}}

helium = elements["helium"]  # get the helium dictionary
hydrogen_weight = elements["hydrogen"]["weight"]  # get hydrogen's weight

# print(helium)
# print(hydrogen_weight)

oxygen = {"number":8,"weight":15.999,"symbol":"O"}  # create a new oxygen dictionary 
elements["oxygen"] = oxygen  # assign 'oxygen' as a key to the elements dictionary
# print('elements = ', elements)


book_title =  ['great', 'expectations','the', 'adventures', 'of', 'sherlock','holmes','the','great','gasby','hamlet','adventures','of','huckleberry','fin']

word_counter = {}

for word in book_title:
    if word not in word_counter:
        word_counter[word] = 1
    else:
        word_counter[word] += 1

# print(word_counter)


cast = {
           "<NAME>": "<NAME>",
           "<NAME>": "<NAME>",
           "<NAME>": "<NAME>",
           "<NAME>": "<NAME>"
       }

# for key, value in cast.items():
    # print("Actor: {}    Role: {}".format(key, value))

#Example 1

result = 0
basket_items = {'pears': 5, 'grapes': 19, 'kites': 3, 'sandwiches': 8, 'bananas': 4}
fruits = ['apples', 'oranges', 'pears', 'peaches', 'grapes', 'bananas']

# Your previous solution here

# print(result)

#Example 2

result = 0
basket_items = {'peaches': 5, 'lettuce': 2, 'kites': 3, 'sandwiches': 8, 'pears': 4}
fruits = ['apples', 'oranges', 'pears', 'peaches', 'grapes', 'bananas']

# Your previous solution here

# print(result)


#Example 3

result = 0
basket_items = {'lettuce': 2, 'kites': 3, 'sandwiches': 8, 'pears': 4, 'bears': 10}
fruits = ['apples', 'oranges', 'pears', 'peaches', 'grapes', 'bananas']

# Your previous solution here
for key, value in basket_items.items():
    if key in fruits:
        result = result + value

# print(result)


verse_dict =  {'if': 3, 'you': 6, 'can': 3, 'keep': 1, 'your': 1, 'head': 1, 'when': 2, 'all': 2, 'about': 2, 'are': 1, 'losing': 1, 'theirs': 1, 'and': 3, 'blaming': 1, 'it': 1, 'on': 1, 'trust': 1, 'yourself': 1, 'men': 1, 'doubt': 1, 'but': 1, 'make': 1, 'allowance': 1, 'for': 1, 'their': 1, 'doubting': 1, 'too': 3, 'wait': 1, 'not': 1, 'be': 1, 'tired': 1, 'by': 1, 'waiting': 1, 'or': 2, 'being': 2, 'lied': 1, 'don\'t': 3, 'deal': 1, 'in': 1, 'lies': 1, 'hated': 1, 'give': 1, 'way': 1, 'to': 1, 'hating': 1, 'yet': 1, 'look': 1, 'good': 1, 'nor': 1, 'talk': 1, 'wise': 1}
# print(verse_dict, '\n')

# find number of unique keys in the dictionary
num_keys = len(verse_dict)
print(num_keys)

# find whether 'breathe' is a key in the dictionary
contains_breathe = "breathe" in verse_dict
print(contains_breathe)

# create and sort a list of the dictionary's keys
sorted_keys = sorted(verse_dict.keys())

# get the first element in the sorted list of keys
print(sorted_keys[0])

# find the element with the highest value in the list of keys
print(sorted_keys[-1]) 
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October']

# print(months[8])

# print(len(months))


list_of_random_things = [1, 3.4, 'a string', True]
# print(list_of_random_things[1:2])

eclipse_dates = ['June 21, 2001', 'December 4, 2002', 'November 23, 2003',
                 'March 29, 2006', 'August 1, 2008', 'July 22, 2009',
                 'July 11, 2010', 'November 13, 2012', 'March 20, 2015',
                 'March 9, 2016']

# print(eclipse_dates[-3:])

new_str = "-".join(["fore", "aft", "starboard", "port"])
# print(new_str)


tuple_a = 1, 2
tuple_b = (1, 2)

# print(tuple_a == tuple_b)
# print(tuple_a[1])


elements = {"hydrogen": 1, "helium": 2, "carbon": 6}
elements["lithium"]=3

# print(elements)

# print("carbon" in elements)

# print(elements.get("dilithium"))

population = {
    "Shanghai" : 17.8,
    "Istanbul" : 13.3,
    "Karachi" : 13.0,
    "Mumbai" : 12.5
}

# print(population["Delhi"])

a = [1, 2, 3]
b = a
c = [1, 2, 3]

# print(a == b)
# print(a is b)
# print(a == c)
# print(a is c)


animals = {'dogs': [20, 10, 15, 8, 32, 15], 'cats': [3,4,2,8,2,4], 'rabbits': [2, 3, 3], 'fish': [0.3, 0.5, 0.8, 0.3, 1]}
# print(animals.get('cats'))


elements = {"hydrogen": {"number": 1,
                         "weight": 1.00794,
                         "symbol": "H"},
              "helium": {"number": 2,
                         "weight": 4.002602,
                         "symbol": "He"}}

helium = elements["helium"]  # get the helium dictionary
hydrogen_weight = elements["hydrogen"]["weight"]  # get hydrogen's weight

# print(helium)
# print(hydrogen_weight)

oxygen = {"number":8,"weight":15.999,"symbol":"O"}  # create a new oxygen dictionary 
elements["oxygen"] = oxygen  # assign 'oxygen' as a key to the elements dictionary
# print('elements = ', elements)


book_title =  ['great', 'expectations','the', 'adventures', 'of', 'sherlock','holmes','the','great','gasby','hamlet','adventures','of','huckleberry','fin']

word_counter = {}

for word in book_title:
    if word not in word_counter:
        word_counter[word] = 1
    else:
        word_counter[word] += 1

# print(word_counter)


cast = {
           "<NAME>": "<NAME>",
           "<NAME>": "<NAME>",
           "<NAME>": "<NAME>",
           "<NAME>": "<NAME>"
       }

# for key, value in cast.items():
    # print("Actor: {}    Role: {}".format(key, value))

#Example 1

result = 0
basket_items = {'pears': 5, 'grapes': 19, 'kites': 3, 'sandwiches': 8, 'bananas': 4}
fruits = ['apples', 'oranges', 'pears', 'peaches', 'grapes', 'bananas']

# Your previous solution here

# print(result)

#Example 2

result = 0
basket_items = {'peaches': 5, 'lettuce': 2, 'kites': 3, 'sandwiches': 8, 'pears': 4}
fruits = ['apples', 'oranges', 'pears', 'peaches', 'grapes', 'bananas']

# Your previous solution here

# print(result)


#Example 3

result = 0
basket_items = {'lettuce': 2, 'kites': 3, 'sandwiches': 8, 'pears': 4, 'bears': 10}
fruits = ['apples', 'oranges', 'pears', 'peaches', 'grapes', 'bananas']

# Your previous solution here
for key, value in basket_items.items():
    if key in fruits:
        result = result + value

# print(result)


verse_dict =  {'if': 3, 'you': 6, 'can': 3, 'keep': 1, 'your': 1, 'head': 1, 'when': 2, 'all': 2, 'about': 2, 'are': 1, 'losing': 1, 'theirs': 1, 'and': 3, 'blaming': 1, 'it': 1, 'on': 1, 'trust': 1, 'yourself': 1, 'men': 1, 'doubt': 1, 'but': 1, 'make': 1, 'allowance': 1, 'for': 1, 'their': 1, 'doubting': 1, 'too': 3, 'wait': 1, 'not': 1, 'be': 1, 'tired': 1, 'by': 1, 'waiting': 1, 'or': 2, 'being': 2, 'lied': 1, 'don\'t': 3, 'deal': 1, 'in': 1, 'lies': 1, 'hated': 1, 'give': 1, 'way': 1, 'to': 1, 'hating': 1, 'yet': 1, 'look': 1, 'good': 1, 'nor': 1, 'talk': 1, 'wise': 1}
# print(verse_dict, '\n')

# find number of unique keys in the dictionary
num_keys = len(verse_dict)
print(num_keys)

# find whether 'breathe' is a key in the dictionary
contains_breathe = "breathe" in verse_dict
print(contains_breathe)

# create and sort a list of the dictionary's keys
sorted_keys = sorted(verse_dict.keys())

# get the first element in the sorted list of keys
print(sorted_keys[0])

# find the element with the highest value in the list of keys
print(sorted_keys[-1]) 
# print(months[8]) # print(len(months)) # print(list_of_random_things[1:2]) # print(eclipse_dates[-3:]) # print(new_str) # print(tuple_a == tuple_b) # print(tuple_a[1]) # print(elements) # print("carbon" in elements) # print(elements.get("dilithium")) # print(population["Delhi"]) # print(a == b) # print(a is b) # print(a == c) # print(a is c) # print(animals.get('cats')) # get the helium dictionary # get hydrogen's weight # print(helium) # print(hydrogen_weight) # create a new oxygen dictionary # assign 'oxygen' as a key to the elements dictionary # print('elements = ', elements) # print(word_counter) # for key, value in cast.items(): # print("Actor: {}    Role: {}".format(key, value)) #Example 1 # Your previous solution here # print(result) #Example 2 # Your previous solution here # print(result) #Example 3 # Your previous solution here # print(result) # print(verse_dict, '\n') # find number of unique keys in the dictionary # find whether 'breathe' is a key in the dictionary # create and sort a list of the dictionary's keys # get the first element in the sorted list of keys # find the element with the highest value in the list of keys