From fb735b9d8873c850e6fe306ad4257fc63eb6c436 Mon Sep 17 00:00:00 2001 From: s45148 Date: Tue, 28 Nov 2017 22:02:45 +0100 Subject: [PATCH] z1, z2, z3, z4, z5, z6, z7 --- labs02/task07.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/labs02/task07.py b/labs02/task07.py index 80cbd37..e370752 100644 --- a/labs02/task07.py +++ b/labs02/task07.py @@ -6,7 +6,10 @@ Napisz funkcję char_sum, która dla zadanego łańcucha zwraca sumę kodów ASCII znaków. """ def char_sum(text): - pass + res = 0 + for i in text: + res += ord(i) + return res def tests(f): inputs = [["this is a string"], ["this is another string"]]