Putting the String issue aside, I just wanted to show the beauty of pattern matching. for i in range(1i, 101) { match (i % 3, i % 5) { (0, 0) => println!("Fizzbuzz"), (0, _) => println!("Fizz"), (_, 0) => println!("Buzz"), _ => println!("{}", i), } } -- edited: removed `.to_string()`, thanks chrismorgan
for i in range (1, 101):
fbsign = (i % 3 == 0, i % 5 == 0)
if fbsign == (1, 1): print("Fizzbuzz")
elif fbsign == (1, 0): print("Fizz")
elif fbsign == (0, 1): print("Buzz")
else: print(i)