From 1e7303220378ec09f9a302c175e33d38716c57bb Mon Sep 17 00:00:00 2001 From: s407545 Date: Sun, 13 May 2018 10:09:17 +0200 Subject: [PATCH] =?UTF-8?q?rozwi=C4=85zanie=20zad.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- labs02/task07.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/labs02/task07.py b/labs02/task07.py index 80cbd37..829a0e4 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 + suma = 0 + for znak in text: + suma= suma + ord(znak) + return suma def tests(f): inputs = [["this is a string"], ["this is another string"]]