From 25bda2319cc9310d09d4145a777c77647780397c Mon Sep 17 00:00:00 2001 From: Madiha Malikzada Date: Sat, 28 Dec 2024 01:50:05 +0530 Subject: [PATCH] added four spaces intstead of tabs to address ci errors --- solutions/name_shuffler.py | 4 +++- solutions/tests/test_name_shuffler.py | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/solutions/name_shuffler.py b/solutions/name_shuffler.py index 707aeb1c5..84dc0da0c 100644 --- a/solutions/name_shuffler.py +++ b/solutions/name_shuffler.py @@ -23,11 +23,13 @@ """ def name_shuffler(string: str): - + assert isinstance(string, str) and string.strip(), "Input must be a non-empty string" split_str = string.split(' ') + reverse_str = split_str[::-1] + return ' '.join(reverse_str) name_shuffler('Mojtaba') \ No newline at end of file diff --git a/solutions/tests/test_name_shuffler.py b/solutions/tests/test_name_shuffler.py index 4d525feac..dfdc1c11e 100644 --- a/solutions/tests/test_name_shuffler.py +++ b/solutions/tests/test_name_shuffler.py @@ -27,3 +27,6 @@ def test_long_name_input(self): if __name__ == '__main__': unittest.main() + + +# run test: python3 -m unittest solutions.tests.test_name_shuffler \ No newline at end of file