forked from tdwojak/Python2018
zadanie 10-11
This commit is contained in:
parent
e225ee691a
commit
3fc2e3d36f
@ -9,7 +9,14 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
|
||||
|
||||
|
||||
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):
|
||||
|
@ -9,7 +9,19 @@ Oba napisy będą składać się wyłacznie z małych liter.
|
||||
"""
|
||||
|
||||
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):
|
||||
|
Loading…
Reference in New Issue
Block a user