311.csv #1

Open
s354567 wants to merge 17 commits from s354567/Python2018:master into master
Showing only changes of commit 472fbffb25 - Show all commits

View File

@ -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"]]
@ -19,4 +28,4 @@ def tests(f):
return "TESTS PASSED" return "TESTS PASSED"
if __name__ == "__main__": if __name__ == "__main__":
print(tests(char_sum)) print(tests(char_sum))