Question: Sorry if not too clear, creating a program to calculate a formula and using cataloged values for one variable which are stored in a nested dictionary. I want to have the user be able to pull values from the dict like so:

```
def get_value():
x = input("Material: ")
if x in materials:
    y = input("Gauge: ")
    if y in x:
        return materials[x][y]
    elif not (not (y is None) and not (y not in x)):
        return 0
elif x not in materials or x is None:
    return "Invalid Punch"

```

is there any specific way to do this that I'm messing up? Every time I try to run it I get a Nonetype, which I have set to replace with a default value of 0.
Dict for reference

```
materials = {"ss": {22: "", 21: "", 20: "0.431", 19: "", 18: ""
        ,17: "", 16: "", 15: "", 14: ""
        ,13: "", 12: "", 11: "", 10: "", 9: "", 8: ""}, }

```

Answer: 
Change your line: `if y in x:` to `if y in materials[x]:` you need to check if `y` is in the dict of `x`. `y in x` checks if `y` is part of `x`
Try this:

```
def get_value():
    x = raw_input("Material: ")
    if x in materials:
        y = raw_input("Gauge: ")
        if int(y) in materials[x]:
            return materials[x][int(y)]
        elif not (not (y is None) and not (y not in x)):
            return 0
    elif x not in materials or x is None:
        return "Invalid Punch"

```

Your problem was the x in y they are both string you need to call if y in materials[x] also converted y to an int. Since input returns Strings in general.