Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics Functions and Looping Functions

fizz buzz challenge.py

name = input("Please enter your name: ")
number = int(input(("Please enter a number: "))

print("hello" , name,"your number is" , number)


if number =(%3==0):
      print("is a Fizz number.")
elif number = (%5==0):
      print("is a Buzz number.")
elif number =(%3==0 and %5==0):
     print("is a FizzBuzz number.")

else number=(%3!=0 and %5!=0):
      print("is neither a fizzy or a buzzy number.")

plz help to fix this code !!

[MOD: added ```python formatting -cf]

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

You have the correct idea. Some syntax to fix up:

  • There's an extra open paren "(" in line 2
  • The modulo syntax is if number % 3 == 0: or if number % 3 == 0 and number % 5 == 0:
  • The last else has a conditional, so it should be an elif instead

That should do it. Post back if you need more help. Good luck!!

Chris Freeman
Chris Freeman
Treehouse Moderator 68,441 Points

There is one additional fix. The order of the if statements need adjusting. Try "15", it should be a FizzBuzz but it gets called a Fizz. Can you see the issue?

I am sorry Second note. I didn't pay attention to it I removed the mark = So are the parentheses. thank you for help