Skip to content

Instantly share code, notes, and snippets.

@lucasrizoli
lucasrizoli / enums3.rs
Created July 15, 2021 18:45
solution to rustlings enums3.rs
// enums3.rs
// Address all the TODOs to make the tests pass!
enum Message {
Move(Point),
Echo(String),
ChangeColor((u8,u8,u8)),
Quit,
}
@lucasrizoli
lucasrizoli / fizzbuzz.py
Created January 1, 2023 01:35
One-line FizzBuzz in Python 3
# One-line FizzBuzz in Python 3 (for my son, who asked me to show him it was possible)
print("\n".join(["Fizz"*(n%3 == 0) + "Buzz"*(n%5 == 0) or str(n) for n in range(1, 15+1)]))