Preparing git repo for final project

This commit is contained in:
2023-07-09 11:19:26 +02:00
parent 6a38966eef
commit 63d06d6b35
67 changed files with 1587 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
from twttr import shorten
def main():
test_uppercase()
test_lowercase()
test_null()
test_digits()
test_punctuation()
def test_uppercase():
assert shorten('TWITTER') == 'TWTTR'
def test_lowercase():
assert shorten('twitter') == 'twttr'
def test_null():
assert shorten('') == ''
def test_digits():
assert shorten('abc123') == 'bc123'
def test_punctuation():
assert shorten('abc,') == 'bc,'
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,16 @@
def main():
tweet = input("Input: \t\t")
result = shorten(tweet)
print(f"Output: {result}")
def shorten(word: str) -> str:
result = ''
for c in word:
if c.lower() not in ('a', 'e', 'i', 'o', 'u'):
result += c
return result
if __name__ == "__main__":
main()