forked from tdwojak/Python2018
zad 10
This commit is contained in:
parent
69e8d10aba
commit
659777d7b2
@ -9,9 +9,14 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
|
|||||||
|
|
||||||
|
|
||||||
def pokemon_speak(text):
|
def pokemon_speak(text):
|
||||||
for i in text:
|
lista = []
|
||||||
if i in text[::2]:
|
for i in range(len(text)):
|
||||||
return i.upper()
|
if i % 2 == 0:
|
||||||
|
lista.append(text[i].upper())
|
||||||
|
else:
|
||||||
|
lista.append(text[i])
|
||||||
|
|
||||||
|
return ''.join(lista)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user