initial commit blyad
This commit is contained in:
14
problems/solution_reversed_string.py
Normal file
14
problems/solution_reversed_string.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import unittest
|
||||
|
||||
#<!-- The Function the User needs to write -->
|
||||
def revstring(x):
|
||||
return x[::-1]
|
||||
|
||||
#<!-- This Test, test if the function works -->
|
||||
class TestSolution(unittest.TestCase):
|
||||
def test_simple(self):
|
||||
x="";
|
||||
self.assertEqual(revstring(x), x[::-1])
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
11
problems/sortlist.py
Normal file
11
problems/sortlist.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import unittest
|
||||
|
||||
class TestSolution(unittest.TestCase):
|
||||
def test_sort(self):
|
||||
# define x as a empty array.
|
||||
# this will be used for the functiun ; a empty var does not work.
|
||||
self.x = []
|
||||
self.assertEqual(sortlist(self.x), sorted(self.x)) ## sort
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user