Thursday, 20 January 2022

Python-Slip5A-Write a Python script using class, which has two methods get_String and print_String. get_String accept a string from the user and print_String print the string in upper case.

 Write a Python script using class, which has two methods get_String and print_String. get_String accept a string from the user and print_String print the string in upper case.       

class IOString():

    def __init__(self):

        self.str1 = ""

    def get_String(self):

        self.str1 = input()

    def print_String(self):

        print(self.str1.upper())

str1 = IOString()

str1.get_String()

str1.print_String()