# -*- coding: utf-8 -*-
"""Copy of dictionaries.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1jsQqJ4FivnaU1qJTKyufBaGsqMRR9LY1

# Dictionaries

- key and value pairs
- key is what we call any hashable object
- hash()
"""

# take in a string
# turn the string in to a meaningful determanistic number

# take in a string
# create a sum variable
# iterate over the string
# turn each char in to a number
# increment sum by that number
# return sum


def my_hash(key):
    sum = 0
    c in key:
        nc = ord(c)
        print(c)
        print(nc)


my_hash("A")

"""
Add "Herb" to the phonebook with the number 7653420789.
Remove "Bill" from the phonebook.
"""
phonebook = {
    "Abe": 4569874321,
    "Bill": 7659803241,
    "Barry": 6573214789
}

# YOUR CODE HERE


# Should print Herb is in the phonebook.
if "Herb" in phonebook:
    print("Herb is in the phonebook.")

# Should print Bill is not in the phonebook.
if "Bill" not in phonebook:
    print("Bill is not in the phonebook.")

"""# Demos"""

"""
Given an array of integers `nums` and an integer `target`, return the indices
of the two numbers that add up to the `target`.
Examples:
- two_sum(nums = [2,5,9,13], target = 7) -> [0,1] (nums[0] + nums[1] == 7)
- two_sum(nums = [4,3,5], target = 8) -> [1,2] (nums[1] + nums[2] == 8)
Notes:
- Each input will have only one solution.
- You may not use the same element twice.
- You can return the answer in any order.
"""



