forked from tdwojak/Python2017
commit
This commit is contained in:
parent
9ef7fa16a0
commit
6b9900253d
@ -10,7 +10,7 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
|
|||||||
|
|
||||||
def pokemon_speak(text):
|
def pokemon_speak(text):
|
||||||
text = list(text)
|
text = list(text)
|
||||||
for x in range(2, len(text),2):
|
for x in range(0, len(text),2):
|
||||||
text[x] = text[x].upper()
|
text[x] = text[x].upper()
|
||||||
x = ''.join(text)
|
x = ''.join(text)
|
||||||
return x
|
return x
|
||||||
@ -18,7 +18,7 @@ def pokemon_speak(text):
|
|||||||
|
|
||||||
|
|
||||||
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):
|
||||||
|
Loading…
Reference in New Issue
Block a user