Zaktualizuj 'labs02/task07.py'
This commit is contained in:
parent
8fb40219cf
commit
472fbffb25
@ -6,7 +6,16 @@ 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