Merge pull request 'Übung 1' (#4) from example1 into master
Reviewed-on: #4 dkjlfxvjkadskjfhjhkbasdrbhjkager
This commit is contained in:
commit
ae4360c13d
@ -5,4 +5,3 @@
|
||||
Aufgabe aus Codewars: https://www.codewars.com/kata/56bc28ad5bdaeb48760009b0
|
||||
|
||||
**Aufgabe:** Funktion zum Abschneiden des ersten und letzten Buchstabens eines übergebenen Strings
|
||||
|
||||
|
||||
6
src/example1.py
Normal file
6
src/example1.py
Normal file
@ -0,0 +1,6 @@
|
||||
def remove_char(s: str) -> str:
|
||||
return s[1:-1]
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(remove_char("hallo"))
|
||||
6
tests/test_example1.py
Normal file
6
tests/test_example1.py
Normal file
@ -0,0 +1,6 @@
|
||||
from src.example1 import remove_char
|
||||
|
||||
|
||||
def test_remove_first_last_char() -> None:
|
||||
assert remove_char("eloquent") == "loquen"
|
||||
assert remove_char("ab") == ""
|
||||
Loading…
x
Reference in New Issue
Block a user