diff --git a/labs02/task06.py b/labs02/task06.py index ff4a9d3..a012606 100644 --- a/labs02/task06.py +++ b/labs02/task06.py @@ -10,7 +10,14 @@ ma być zwracany napis "It's not a Big 'No!'". """ def big_no(n): - pass + if n < 5: + return "It's not a Big 'No!'" + w = 'N' + for i in range(n): + w += 'O' + w += '!' + return w + def tests(f): inputs = [[5], [6], [2]] diff --git a/labs02/task07.py b/labs02/task07.py index 80cbd37..56c9551 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 + suma = 0 + for a in text: + suma += ord(a) + #print suma + return suma def tests(f): inputs = [["this is a string"], ["this is another string"]]