1
0
Fork 0
This commit is contained in:
Adam 2018-05-15 22:47:14 +02:00
parent d6f4abe562
commit 489e0e84cc
2 changed files with 19 additions and 3 deletions

View File

@ -10,8 +10,15 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
def pokemon_speak(text):
lista = list(text)
lista[::2].capitalize()
wynik = "".join(lista)
result = []
for i in range(len(lista)):
if i == 0 or i % 2 == 0:
result.append(lista[i].upper())
else:
result.append(lista[i])
wynik = "".join(result)
return wynik

View File

@ -9,7 +9,16 @@ Oba napisy będą składać się wyłacznie z małych liter.
"""
def common_chars(string1, string2):
pass
string1 = string1.replace(' ','')
string2 = string2.replace(' ','')
lista1 = list(string1)
lista2 = list(string2)
wynik = set()
wynik = {x for x in lista1 if x in lista2}
result = list(wynik)
result.sort()
return result
def tests(f):