z1, z2, z3, z4, z5, z6, z7, z8, z9, z10
This commit is contained in:
parent
181d55ab25
commit
f29a32cacd
@ -9,11 +9,19 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
|
||||
|
||||
|
||||
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):
|
||||
inputs = [['pokemon'], ['do not want'], 'POKEMON']
|
||||
inputs = [['pokemon'], ['do not want'], ['POKEMON']]
|
||||
outputs = ['PoKeMoN', 'Do nOt wAnT', 'POKEMON']
|
||||
|
||||
for input, output in zip(inputs, outputs):
|
||||
@ -23,4 +31,4 @@ def tests(f):
|
||||
return "TESTS PASSED"
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(tests(pokemon_speak))
|
||||
print(tests(pokemon_speak))
|
Loading…
Reference in New Issue
Block a user