1
0
forked from tdwojak/Python2017

z1, z2, z3, z4, z5, z6, z7

This commit is contained in:
s45148 2017-11-28 22:02:45 +01:00
parent 2956c1c3e0
commit fb735b9d88

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