我想打印'好吧,謝謝'。當我在殼上運行它時,它會在單獨的行上打印,'謝謝'在'好的'之前打印。任何人都可以幫助我做錯了什麼?如何在python中的另一種方法中調用類方法?
>>> test1 = Two()
>>> test1.b('abcd')
>>> thanks
>>> okay
我的代碼
class One:
def a(self):
print('thanks')
class Two:
def b(self, test):
test = One()
print('okay', end = test.a())