Define a class which has at least two methods:


Topic: Define a class which has at least two methods:

Solution

class InputOutString(object):
    def __init__(self):
        self.s = ""
    def getString(self):
        self.s = input()
    
    def printString(self):
        print(self.s.upper())
strObj = InputOutString()
strObj.getString()
strObj.printString()



List all Python Programs