This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Първа задача | |
(define (in-figure x y) | |
(cond ((and (and (>= x 1) (<= x 2)) (and (>= y -1) (<= y 0.5))) #t) | |
((and (and (>= x 0) (<= x 1)) (and (>= y -1) (<= y 1))) #t) | |
((and (>= (expt (+ (expt (+ x 1) 2) (expt y 2)) 0.5) 1) | |
(and (>= x -1) (<= x 0)) | |
(and (>= y -1) (<= y 1))) #t) | |
(else #f))) | |
;(in-figure 0 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from solution import wow_such_much, count_doge_words | |
class TestDoge(unittest.TestCase): | |
def test_suchmuch_from_negative(self): | |
self.assertEqual(wow_such_much(-5, 7), | |
['much', '-4', 'such', '-2', '-1', 'suchmuch', '1', '2', 'such', '4', 'much', 'such']) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
PARASITE_WORDS = ("wow", "lol", "so", "such", "much", "very") | |
def wow_such_much(start, end): | |
return list(map(change_number, range(start, end))) | |
def change_number(number): | |
if number % 15 == 0: | |
return "suchmuch" |