#!/usr/bin/env python # -*- coding: utf-8 -*- """ https://www.codeeval.com/open_challenges/1/ : Fizz Buzz Read X, Y,N : count from 1 until N. Any number divisible by X is replaced by the word fizz, and any divisible by Y by the word buzz. Numbers divisible by both become fizz buzz. """ if __name__ == "__main__": print('Introduce X, Y, N separated by commas') inp = input().split(',') X, Y, N = int(inp[0].strip()), int(inp[1].strip()), int(inp[2].strip()) print(X, Y, N) c = "" for i in range(1,N+1): if i % X == 0: c += 'fizz' if i % Y == 0: c += 'buzz' if i % X != 0 and i % Y != 0: c += str(i) c += " " print(c.rstrip())