# My python function returning NoneType object is not callable

**URL:** <https://forum.freecodecamp.org/t/my-python-function-returning-nonetype-object-is-not-callable/444515>\
**Category:** General\
**Created:** [February 5, 2021, 1:40am UTC](https://forum.freecodecamp.org/t/my-python-function-returning-nonetype-object-is-not-callable/444515 "2021-02-05T01:40:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![administrator1](https://avatars.discourse-cdn.com/v4/letter/a/e9c0ed/32.png) [@administrator1](https://forum.freecodecamp.org/u/administrator1)\
**Post date:** [February 5, 2021, 1:40am UTC](https://forum.freecodecamp.org/t/my-python-function-returning-nonetype-object-is-not-callable/444515/1 "2021-02-05T01:40:19Z")

</div>

```auto
def bill_of_materials(**kwargs):
    def production(qty):
        for key, value in kwargs.items():
            total = {key : value*qty}
    return total

f = bill_of_materials (a = 2, b = 3, c = 4)
qty = float(input('enter qty : '))
usage = f(qty)

```

The code returning NoneType Error.

---

<div class="post-metadata">

**Author:** ![sanity](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sanity/32/378897_2.png) [@sanity](https://forum.freecodecamp.org/u/sanity)\
**Post date:** [February 5, 2021, 5:02am UTC](https://forum.freecodecamp.org/t/my-python-function-returning-nonetype-object-is-not-callable/444515/2 "2021-02-05T05:02:20Z")

</div>

Take a closer look at `bill_of_materials` function, happens in it and what it returns.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [August 6, 2021, 5:03pm UTC](https://forum.freecodecamp.org/t/my-python-function-returning-nonetype-object-is-not-callable/444515/3 "2021-08-06T17:03:03Z")

</div>

Closed on August 6, 2021, 5:03pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
