z1, z2, z3, z4, z5, z6, z7, z8, z9, z10

This commit is contained in:
s45148 2017-11-29 00:37:01 +01:00
parent 181d55ab25
commit f29a32cacd

View File

@ -9,11 +9,19 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
def pokemon_speak(text): def pokemon_speak(text):
pass res = ""
c = 1
for i in text:
if c%2 == 0:
res += i
else:
res += i.upper()
c += 1
return res
def tests(f): def tests(f):
inputs = [['pokemon'], ['do not want'], 'POKEMON'] inputs = [['pokemon'], ['do not want'], ['POKEMON']]
outputs = ['PoKeMoN', 'Do nOt wAnT', 'POKEMON'] outputs = ['PoKeMoN', 'Do nOt wAnT', 'POKEMON']
for input, output in zip(inputs, outputs): for input, output in zip(inputs, outputs):
@ -23,4 +31,4 @@ def tests(f):
return "TESTS PASSED" return "TESTS PASSED"
if __name__ == "__main__": if __name__ == "__main__":
print(tests(pokemon_speak)) print(tests(pokemon_speak))