From a7c1e1c983c8041957752de9f5df45b1d63c47de Mon Sep 17 00:00:00 2001 From: N4shat <91386631+N4shat@users.noreply.github.com> Date: Sun, 26 Sep 2021 00:07:38 +0300 Subject: [PATCH] Update python_pass.py --- python_pass.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python_pass.py b/python_pass.py index 9616d7a..ace783e 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 @@ -10,5 +9,11 @@ class StringOperations: - def reverse(self, *, to_be_reversed: str = None): + 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::-1] +rv=ReversedString() + +print(rv.reverse(input("enter : ")))