FizzBuzzWhizz
FizzBuzzWhizz
Read a number N and, for every whole number from 1 to N in order, print the number itself unless it is a multiple of 3, 5 or 7, in which case print the words Fizz (for 3), Buzz (for 5) and Whizz (for 7) joined into one word with no spaces, in that order, for every one of the three that divides it: a multiple of 3 and 5 gives FizzBuzz, and a multiple of all three gives FizzBuzzWhizz. All N results go on ONE line separated by single spaces, so use print(..., end=' ') for each and a bare print() at the end. Use a while loop and the remainder operator %; build the word in a string that starts empty for every number and print the number only when that string is still empty. Input: one integer, no prompt.
Expected Output:
1 2 Fizz 4 Buzz Fizz Whizz 8 Fizz Buzz 11 Fizz 13 Whizz FizzBuzz 16 17 Fizz 19 Buzz FizzWhizz= newline. The output ends with a newline — print one after the last line.
Your Output
Run your code to see the output here...