# Fizz Buzz exercise for python

**URL:** <https://forum.codewithmosh.com/t/fizz-buzz-exercise-for-python/17095>\
**Category:** Python\
**Created:** [December 19, 2022, 12:04am UTC](https://forum.codewithmosh.com/t/fizz-buzz-exercise-for-python/17095 "2022-12-19T00:04:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zak](https://avatars.discourse-cdn.com/v4/letter/z/8e7dd6/32.png) [@Zak](https://forum.codewithmosh.com/u/Zak)\
**Post date:** [December 19, 2022, 12:04am UTC](https://forum.codewithmosh.com/t/fizz-buzz-exercise-for-python/17095/1 "2022-12-19T00:04:27Z")

</div>

Hello everyone, so I wrote the code exactly as it is for the fizz buzz exercise, it does not work , I even did not start with solving the problem. here is a screenshot

 ![● app.py - HelloZift - Visual Studio Code 12_19_2022 12_58_04 AM](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/5/510fb7ca380f13cdef2b5bf9fdc2a9f959b12dca.png)

def fizz\_buzz(input):

print(fizz\_buzz(3))

---

<div class="post-metadata">

**Author:** ![MTownsend](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/mtownsend/32/6311_2.png) [@MTownsend](https://forum.codewithmosh.com/u/MTownsend)\
**Post date:** [December 19, 2022, 4:46pm UTC](https://forum.codewithmosh.com/t/fizz-buzz-exercise-for-python/17095/2 "2022-12-19T16:46:19Z")

</div>

I am pretty sure you can not define a function and then not include a function body (the code that needs to run when the function is called).

try adding something to the body like

```python
def fizz_buzz(input):
    print(input);

fizz_buzz(3)

```

---

<div class="post-metadata">

**Author:** ![Zak](https://avatars.discourse-cdn.com/v4/letter/z/8e7dd6/32.png) [@Zak](https://forum.codewithmosh.com/u/Zak)\
**Post date:** [December 19, 2022, 5:35pm UTC](https://forum.codewithmosh.com/t/fizz-buzz-exercise-for-python/17095/3 "2022-12-19T17:35:18Z")

</div>

I was doubting it as well.  
I wrote your code but when I call it the result is the same number i wrote. nu fizz nu buzz

 ![app.py - HelloZift - Visual Studio Code 12_19_2022 6_34_12 PM](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/3/3a71288fa5d50eecbe7387ef9c4f59978ce6e106.png)

---

<div class="post-metadata">

**Author:** ![MTownsend](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/mtownsend/32/6311_2.png) [@MTownsend](https://forum.codewithmosh.com/u/MTownsend)\
**Post date:** [December 19, 2022, 8:32pm UTC](https://forum.codewithmosh.com/t/fizz-buzz-exercise-for-python/17095/4 "2022-12-19T20:32:35Z")

</div>

You said you did not write any logic for it yet, so I was thinking you were just trying to test setting up a function and calling it. In the way it is written the function will always print the number 3, because that is the argument you are passing to it when you call it on line 5.

The function contains one line of code in the body, which is to print whatever you argument you passed to the input parameter.

If you are wanting it to do the complete exercise, then you can view the course solution. If you have no idea what is going on then you need to back-up to the point in the course you felt comfortable and try again.

---

<div class="post-metadata">

**Author:** ![Zak](https://avatars.discourse-cdn.com/v4/letter/z/8e7dd6/32.png) [@Zak](https://forum.codewithmosh.com/u/Zak)\
**Post date:** [December 19, 2022, 8:43pm UTC](https://forum.codewithmosh.com/t/fizz-buzz-exercise-for-python/17095/5 "2022-12-19T20:43:28Z")

</div>

I thought about that but the problem is that fizz buzz is only mentioned in the exercise and its the only thing that doesn’twork, I understood the idea, but its just the code that I wrote doesn’t work somehow. (the one in the exercise )I will try to do the solution as it is ,I have no other option. thanks man for your tips, I appreciate it.
