1
0
Fork 0

zrobione zad 10

This commit is contained in:
Justyna Adamczyk 2018-05-31 18:28:58 +00:00
parent 655c576a5a
commit 74f9c6a5e5
1 changed files with 9 additions and 2 deletions

View File

@ -7,10 +7,17 @@ Napisz funkcję pokemon_speak, która zamienia w podanym napisie co drugą liter
na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
"""
def pokemon_speak(text):
pass
listy = []
for i in range(len(text)):
if i % 2 == 0:
listy.append(text[i].upper())
else:
listy.append(text[i])
return ''.join(listy)
def tests(f):
inputs = [['pokemon'], ['do not want'], ['POKEMON']]