Python-programming-exercises
Python-programming-exercises copied to clipboard
Question 5
Is the solution for question 5 correct?
I found it couldn't produce the expected output, did I miss anything?
yes,the solution is correct
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()