1
0
forked from tdwojak/Python2017
This commit is contained in:
s45147 2017-11-20 09:36:10 +01:00
parent c6901ebfc2
commit 7cc01637fb

View File

@ -6,7 +6,10 @@ 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 suma = 0
for c in text:
suma += ord(c)
return suma
def tests(f): def tests(f):
inputs = [["this is a string"], ["this is another string"]] inputs = [["this is a string"], ["this is another string"]]