def test_add(): print("In add test") added = demo.add("hej ", "hopp") test.assert_equal("hej hopp", added) test.assert_not_equal("hej", added)
def test_echo(): print("In echo test") echo = demo.echo("hej") test.assert_equal("hej", echo) test.assert_not_equal(None, echo)
from test import assert_equal def is_isogram(string): t = {} for x in string.lower(): if string.lower().count(x) > 1: t[x] = False return True if len(t.keys()) == 0 else False # Another solutions: '''string = string.lower() for letter in string: if string.count(letter) > 1: return False return True #return len(string) == len(set(string.lower()))''' assert_equal(is_isogram("Dermatoglyphics"), True) assert_equal(is_isogram("aba"), False)