https://git.wmi.amu.edu.pl/tdwojak/Python2017/src/master/labs03 #1
@ -9,7 +9,23 @@ na wielką. Np. pokemon_speak('pokemon') powinno zwrócić 'PoKeMoN'.
|
|||||||
|
|
||||||
|
|
||||||
def pokemon_speak(text):
|
def pokemon_speak(text):
|
||||||
pass
|
value = ''
|
||||||
|
b = True
|
||||||
|
for i in text:
|
||||||
|
value += i.upper() if b else i.lower()
|
||||||
|
b = not b
|
||||||
|
if i.isupper() == True:
|
||||||
|
return print(text)
|
||||||
|
else:
|
||||||
|
return print(value)
|
||||||
|
|
||||||
|
|
||||||
|
pokemon_speak('pokemon')
|
||||||
|
pokemon_speak('do not want')
|
||||||
|
pokemon_speak('POKEMON')
|
||||||
|
|
||||||
|
#DLACZEGO WYSWIETLA ERROR SKORO PROGRAM DZIALA PRAWIDLOWO ??????
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def tests(f):
|
def tests(f):
|
||||||
|
Loading…
Reference in New Issue
Block a user