- Python >=3.7
- Poetry
poetry install
poetry run pytest
or activate the virtualenv
poetry shell
and run
pytest
A classic exercise for beginners, one that can show the basics of TDD.
- Create a function called
fizzBuzz
that takes a number as input and returns it as a string - When input is a multiple of
3
, return"Fizz"
instead of the number - When input is a multiple of
4
, return"Buzz"
instead of the number - When input is a multple of both
3
and4
, return"FizzBuzz"
Another classic exercise. The function should return a True
if the password is valid and False
otherwise as well as an error message to help the user.
- The password must be
8
characters long. If not, then the following error message should be returned"Password must be at least 8 character"
- The password must contain at least
2
numbers. If not, then the following error message should be returned"Password must contain at least 2 numbers"
- The password must contain at least
1
capital letter. If not, then the following error message should be returned"Password mnust contain at least one capital letter"
- The password must contain at least
1
special character. If not, then the following message should be returned"Password must contain at least one special character"
- The function should handle multiple validation errors. If there are multiple errors then the messages of those corresponding errors should all appear in the message.