From 74f9c6a5e5ab58588a7eb539093fe78810079593 Mon Sep 17 00:00:00 2001 From: Justyna Adamczyk Date: Thu, 31 May 2018 18:28:58 +0000 Subject: [PATCH] zrobione zad 10 --- labs02/task10.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/labs02/task10.py b/labs02/task10.py index 58d40d2..1b140ab 100644 --- a/labs02/task10.py +++ b/labs02/task10.py @@ -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']]