diff --git a/python_pass.py b/python_pass.py index 9616d7a..5ead654 100644 --- a/python_pass.py +++ b/python_pass.py @@ -1,14 +1,10 @@ -""" -Instructions: - -1. Create a class named ReversedString that inherits from StringOperations class -2. Implement the function reverse -3. reverse function should be a one liner function that returns the reverse string to_be_reversed -4. Instantiate the class ReversedString -5. Print to show your function implementation result -""" - - class StringOperations: def reverse(self, *, to_be_reversed: str = None): raise NotImplemented('This method need to be implemented') + +class ReversedString (StringOperations): + def reverse(self, *, to_be_reversed: str = None): + return to_be_reversed[::-1] + +rev = ReversedString() +print(rev.reverse(to_be_reversed=input("enter some text: ")))