forked from tdwojak/Python2017
commited tasks
This commit is contained in:
parent
141caa611c
commit
2e77b2ed58
@ -6,10 +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):
|
||||||
suma = 0
|
sumaAsci = 0
|
||||||
for i in text
|
for i in text
|
||||||
suma += ord(i)
|
sumaAsci += sumaAsci(i)
|
||||||
return suma
|
return sumaAsci
|
||||||
|
|
||||||
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