Light Mode
Dark Mode
Can I use this to solve the task ?

I wrote this with my local Python2.7 and it worked well. But when I pasted it on the website, the web just kept notifying invalid syntax. What's wrong with my code? Help, plz.

print'What number do you want to put?' yes = False

while yes == False: num = input()

if (num %3 == 0) and (num %5 == 0):
   print'This is a Fizz Buzz.'
   yes = True

if (num %3 != 0) and (num %5 == 0):
   print'This is a Buzz.'

if (num %3 == 0) and (num %5 != 0):
   print'This is a Fizz.'

if(num %3 != 0) and (num %5 != 0):
   print'This is neither a Fizz nor a Buzz.'
Created: July 28, 2015, 1 p.m.
Updated: July 29, 2015, 4:11 a.m.
0
4
User avatar
april0523