python

Write a Python program that outputs the numbers from 1 to 100. However, if the
number is divisible by 3, it should output Fizz instead. If the number is divisible by 5,
it should output Buzz instead. If the number is divisible by both 3 and 5, output
Fizzbuzz. An example output for the first 36 numbers would be:
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz,
19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz,
Fizz, …

You can leave a response, or trackback from your own site.
Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes