forked from tdwojak/Python2018
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.
|
||||
"""
|
||||
def char_sum(text):
|
||||
pass
|
||||
|
||||
sumujemy = 0
|
||||
|
||||
for znaki in text:
|
||||
|
||||
sumujemy = sumujemy + ord(znaki)
|
||||
|
||||
|
||||
return sumujemy
|
||||
|
||||
|
||||
def tests(f):
|
||||
inputs = [["this is a string"], ["this is another string"]]
|
||||
@ -19,4 +28,4 @@ def tests(f):
|
||||
return "TESTS PASSED"
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(tests(char_sum))
|
||||
print(tests(char_sum))
|
Loading…
Reference in New Issue
Block a user