forked from tdwojak/Python2018
rozwiazanie dom
This commit is contained in:
parent
4d6c11789d
commit
3445d715ab
@ -6,7 +6,11 @@ Napisz funkcję char_sum, która dla zadanego łańcucha zwraca
|
|||||||
sumę kodów ASCII znaków.
|
sumę kodów ASCII znaków.
|
||||||
"""
|
"""
|
||||||
def char_sum(text):
|
def char_sum(text):
|
||||||
pass
|
sumujemy = 0
|
||||||
|
for znaki in text:
|
||||||
|
sumujemy = sumujemy + ord(znaki)
|
||||||
|
return sumujemy
|
||||||
|
|
||||||
|
|
||||||
def tests(f):
|
def tests(f):
|
||||||
inputs = [["this is a string"], ["this is another string"]]
|
inputs = [["this is a string"], ["this is another string"]]
|
||||||
|
Loading…
Reference in New Issue
Block a user