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):
|
||||
for i in text:
|
||||
if i in text[::2]:
|
||||
return i.upper()
|
||||
lista = []
|
||||
for i in range(len(text)):
|
||||
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