Write a function in the Wolfram Language that generates a list from 1 to 100, replacing multiples of 3 with "Fizz", multiples of 5 with "Buzz", and multiples of both with "FizzBuzz".
Hint 1
First generate a list of the numbers 1 to 100 and in the next step replace the numbers accordingly.
Solution
Table[ Which[ Mod[n, 15] == 0, "FizzBuzz", Mod[n, 3] == 0, "Fizz", Mod[n, 5] == 0, "Buzz", True, n ], {n, 1, 100} ]
- URL:
- Language:
- Subjects: Computer Science
- Type: Name
- Duration: 20min
- Credits: 2
- Difficulty: 0.2
- Tags: Wolfram Language
- Note:
- Created By: ad-si
- Created At:
2026-03-02 23:28:17 UTC - Last Modified:
2026-03-02 23:28:17 UTC