Python-programming-exercises icon indicating copy to clipboard operation
Python-programming-exercises copied to clipboard

Question 5

Open CWJWANJING opened this issue 6 years ago • 2 comments

Is the solution for question 5 correct?

I found it couldn't produce the expected output, did I miss anything?

CWJWANJING avatar Jun 17 '19 11:06 CWJWANJING

yes,the solution is correct

CHAMP-123 avatar Jul 12 '19 04:07 CHAMP-123

this my code

class FirstClass(object):
    def __init__(self):
        self.string = ''
        
    def getString(self, string):
        self.string = string
        
    def printString(self):
        print(self.string)
        
test = FirstClass()
test.getString('hello world')
test.printString()

ResistanceTo avatar Sep 17 '19 08:09 ResistanceTo