forked from computiq/python-pass
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_pass.py
More file actions
33 lines (24 loc) · 1001 Bytes
/
Copy pathpython_pass.py
File metadata and controls
33 lines (24 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
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
"""
"""
* Noaman Monther Mahmood
* YANHAD Coding Bootcamp (Tasks - 1)
* Python Side
* Use Better Comments {for better experiance with this task solution}
* https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
"""
class StringOperations:
def reverse(self, *, to_be_reversed: str = None):
raise NotImplemented('This method need to be implemented')
# overriding the function from inherited class and using it,
class ReversedString(StringOperations):
def reverse(self, *, to_be_reversed: str = None):
return to_be_reversed[::-1]
reversed = ReversedString()
print(reversed.reverse(to_be_reversed='Noaman Monther👏🏻'))