Write a Python Class to Reverse a String Word by Word
Hello Programmers, Welcome to my channel.
In this video you will learn about how to Write a Python Class to Reverse a String Word by Word
Code 1
=============================
class reverse:
def __init__(self):
self.text = ""
self.result = ""
def get(self):
self.text = input("Enter a string : ")
def execute(self):
for word in self.text.split():
self.result += word[::-1] + " "
def display(self):
print(f"Reverse of string word by word is : {self.result}")
string_obj = reverse()
string_obj.get()
string_obj.execute()
string_obj.display()
Code 2
========================
https://codewithtj.blogspot.com/2023/02/python-class-to-reverse-string-word-by.html
Keywords
=============================
#python #python3 #python_assignment #pythonprogramming #pythontutorial #pythonprojects #pythoncourse #pythonbaba #pythonforbeginners #pythonautomation #pythonbasic #pythonbeginners
Видео Write a Python Class to Reverse a String Word by Word автора Молодые питонисты-кодеры
Видео Write a Python Class to Reverse a String Word by Word автора Молодые питонисты-кодеры
Информация
2 декабря 2023 г. 6:27:09
00:05:53
Похожие видео