Ответ Check50:
Results for cs50/problems/2022/python/tests/twttr generated by check50 v4.0.0.dev0
expected exit code 0, not 1
:| test_twttr catches twttr.py without vowel replacement
can't check until a frown turns upside down
:| test_twttr catches twttr.py without capitalized vowel replacement
can't check until a frown turns upside down
:| test_twttr catches twttr.py without lowercase vowel replacement
can't check until a frown turns upside down
:| test_twttr catches twttr.py omitting numbers
can't check until a frown turns upside down
:| test_twttr catches twttr.py printing in uppercase
can't check until a frown turns upside down
:| test_twttr catches twttr.py omitting punctuation
can't check until a frown turns upside down
To see more detailed results go to https://submit.cs50.io/check50/a3a769a4 ... 0f6153b95d
Это мой код twttr.py:
def main():
usin = input("Input: ")
print (f"Output: {convert(usin)}")
def convert(uword):
vowels = ["a","A","e","E","i","I","o","O","u","U"]
newword = ""
for i in range(len(uword)):
if uword not in vowels:
newword = (newword + uword)
return newword
if __name__ == "__main__":
main()
Это мой код test_twttr.py:
import twttr
def test_no_vowels():
assert twttr.convert("bcdfghjk") == "bcdfghjk"
def test_lower_vowels():
assert twttr.convert("aeiouz") == "z"
def test_upper_vowels():
assert twttr.convert("AEIOUz") == "z"
def test_number():
assert twttr.convert("8abc") == "8bc"
def test_uppercase():
assert twttr.convert("LALALAlalala") == "LLLlll"
def test_punctuation():
assert twttr.convert("hello,!#*& world") == "hll,!#*& wrld"