我对 if 语句有疑问。我在函数中有一个 if 语句。在这里,我确定当我的变量小于 0 时,它应该只打印一个特定的句子,但在这里停止。所以函数不应该在这里继续下去。我怎样才能做到这一点?
def __init__(self, business account ):
self.business = business
if account < 0:
print('The balance is negative, therefore an account cannot be created!') #break
else:
self.account = account