From 3445d715abf43befb3b1b215d52f4f0b33d7663d Mon Sep 17 00:00:00 2001 From: s407531 Date: Sun, 13 May 2018 10:07:40 +0200 Subject: [PATCH] rozwiazanie dom --- labs02/task07.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/labs02/task07.py b/labs02/task07.py index 80cbd37..e4c23c9 100644 --- a/labs02/task07.py +++ b/labs02/task07.py @@ -6,7 +6,11 @@ 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"]]