Open/closed principle Example in Python
01 Jul 2015
Tags:
python
coding
·
- print any number divisible by three with the word “fizz” instead of
the number.
- print any number divisible by five with the word “buzz” instead of
the number.
- print any number divisible by seven with the word “bang” instead of
the number.
FizzBuzz Nested If
FizzBuzz OCP
References:
- แนะนำปฏิทิน SOLID
Principle
- Python SOLID
- Open/closed principle
- Fizz buzz