diff --git a/main.py b/main.py new file mode 100644 index 0000000..1e3e6d5 --- /dev/null +++ b/main.py @@ -0,0 +1,10 @@ +def count(phrase: str, letter: str) -> int: + count = 0 + for char in phrase: + if char.lower() == letter.lower(): + count += 1 + return count + + +print(count('hello world', letter='h')) +count('hello world', letter='l') diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..afff680 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +flake8==5.0.4 +flake8-annotations==2.9.1 +flake8-quotes==3.3.1 +flake8-variables-names==0.0.5 +pep8-naming==0.13.2 +pytest==7.1.3 \ No newline at end of file