1
0
forked from tdwojak/Python2018

zadanie 10-11

This commit is contained in:
Mikaszaaa 2018-05-30 11:37:18 +02:00
parent e225ee691a
commit 3fc2e3d36f
2 changed files with 21 additions and 2 deletions

View File

@ -9,7 +9,14 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
def pokemon_speak(text): def pokemon_speak(text):
pass lista = []
for i in range(len(text)):
if i % 2 == 0:
lista.append(text[i].upper())
else:
lista.append(text[i])
text = "".join(lista)
return text
def tests(f): def tests(f):

View File

@ -9,7 +9,19 @@ Oba napisy będą składać się wyłacznie z małych liter.
""" """
def common_chars(string1, string2): def common_chars(string1, string2):
pass lista = []
result = []
for i in range(len(string1)):
lista.append(string1[i])
for j in range(len(string2)):
if string2[j] in lista:
result.append(string2[j])
nowa = list(set(result))
for i in nowa:
if ord(i) == 32:
nowa.remove(i)
nowa.sort()
return nowa
def tests(f): def tests(f):