<jupyter_start><jupyter_text>Write a function named sum_values that takes a dictionary named my_dictionary as a parameter. The function should return the sum of the values of the dictionary<jupyter_code>def sum_values(dicionario):

    """
    sum of the values of the dictionary.
    args: input: dictionary
          return: sum of values from dictionary
    """
    sum_values = 0
    for value in dicionario.values():
        sum_values += value
    return sum_values


    




# Uncomment these function calls to test your sum_values function:
print(sum_values({"milk":5, "eggs":2, "flour": 3}))
# should print 10
print(sum_values({10:1, 100:2, 1000:3}))
# should print 6<jupyter_output>10
6<jupyter_text>Create a function called sum_even_keys that takes a dictionary named my_dictionary, with all integer keys and values, as a parameter. This function should return the sum of the values of all even keys.<jupyter_code>def sum_even_keys(my_dictionary):

  sum_even_keys = 0
  
  for key, value in my_dictionary.items():
    if key % 2 == 0:
      sum_even_keys += value
  return sum_even_keys
# Uncomment these function calls to test your  function:
print(sum_even_keys({1:5, 2:2, 3:3}))
# should print 2
print(sum_even_keys({10:1, 100:2, 1000:3}))
# should print 6<jupyter_output>2
6<jupyter_text>Create a function named add_ten that takes a dictionary with integer values named my_dictionary as a parameter. The function should add 10 to every value in my_dictionary and return my_dictionary<jupyter_code>def add_ten(my_dictionary):
    '''
    The function should add 10 to every value in my_dictionary and return my dictionary.
    args:
         input - my_dictionary with integer values
         return - my_dictionary
    '''
    for key, value in my_dictionary.items():
        my_dictionary[key] += 10
    return my_dictionary
print(add_ten({1:5, 2:2, 3:3}))
# should print {1:15, 2:12, 3:13}
print(add_ten({10:1, 100:2, 1000:3}))
# should print {10:11, 100:12, 1000:13}<jupyter_output>{1: 15, 2: 12, 3: 13}
{10: 11, 100: 12, 1000: 13}<jupyter_text>Create a function named values_that_are_keys that takes a dictionary named my_dictionary as a parameter. This function should return a list of all values in the dictionary that are also keys.<jupyter_code>def values_that_are_keys(my_dictionary):
    '''
    This function return a list of all values in the dictionary that are also keys.
    args:
        input - my_dictionary
        return - list of all values are also keys.
    '''
    list_values = []
    for value in my_dictionary.values():
        if value in my_dictionary.keys():
            list_values.append(value)
    return list_values
print(values_that_are_keys({1:100, 2:1, 3:4, 4:10}))
# should print [1, 4]
print(values_that_are_keys({"a":"apple", "b":"a", "c":100}))<jupyter_output>[1, 4]
['a']<jupyter_text>Write a function named max_key that takes a dictionary named my_dictionary as a parameter. The function should return the key associated with the largest value in the dictionary.<jupyter_code>def max_key(my_dictionary):

    largest_key = ""
    largest_value = float("-inf")
    for key, value in my_dictionary.items():
        if value > largest_value:
            largest_value = value
            largest_key = key
    return largest_key
print(max_key({1:100, 2:1, 3:4, 4:10}))
# should print 1
print(max_key({"a":100, "b":10, "c":1000}))
# should print "c"<jupyter_output>1
c<jupyter_text>Write a function named word_length_dictionary that takes a list of strings named words as a parameter. The function should return a dictionary of key/value pairs where every key is a word in words and every value is the length of that word<jupyter_code>def word_length_dictionary(words):
    
    # args: list of strings 
    # return dict{word:len(word)}

    dictionary = {}
    for word in words:
        dictionary[word] = len(word)
    return dictionary
print(word_length_dictionary(["apple", "dog", "cat"]))
# should print {"apple":5, "dog": 3, "cat":3}<jupyter_output>{'apple': 5, 'dog': 3, 'cat': 3}<jupyter_text>Write a function named frequency_dictionary that takes a list of elements named words as a parameter. The function should return a dictionary containing the frequency of each element in words.<jupyter_code>def frequency_dictionary(words):
  freqs = {}
  for word in words:
    if word not in freqs:
    	freqs[word] = 0
    freqs[word] += 1
  return freqs
print(frequency_dictionary(["apple", "apple", "cat", 1]))<jupyter_output>{'apple': 2, 'cat': 1, 1: 1}<jupyter_text>Create a function named unique_values that takes a dictionary named my_dictionary as a parameter. The function should return the number of unique values in the dictionary.<jupyter_code>def unique_values(my_dictionary):
  seen_values = []
  for value in my_dictionary.values():
    if value not in seen_values:
      seen_values.append(value)
  return len(seen_values)
print(unique_values({0:3, 1:1, 4:1, 5:3}))<jupyter_output>2
{'fraction_non_alphanumeric': 0.09925358079483558, 'fraction_numerical': 0.036514020576961875, 'mean_word_length': 4.308351177730192, 'pattern_counts': {'":': 12, '<': 25, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '552635', 'license': 'MIT', 'n_tokens_mistral': 1700, 'n_tokens_neox': 1529, 'n_words': 542, 'path': 'dicts_review.ipynb', 'repo_name': 'FabioCLima/Python---projects-notebooks', 'size': '4957'}