From c8ba691f676431245184c464f978ae617233d313 Mon Sep 17 00:00:00 2001 From: AhmadPhenox <90383673+AhmadPhenox@users.noreply.github.com> Date: Sat, 25 Sep 2021 23:01:06 +0300 Subject: [PATCH] Update python_pass.py --- python_pass.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python_pass.py b/python_pass.py index 9616d7a..c6c0f57 100644 --- a/python_pass.py +++ b/python_pass.py @@ -1,6 +1,5 @@ """ 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 @@ -12,3 +11,10 @@ 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] + +re = ReversedString() +print(re.reverse(to_be_reversed=input("Enter your srting : ")))