logo

Crowdly

Browser

Add to Chrome

Atzīmē pareizo atbildi! Kāda būs acc2.balance vērtība pēc transfer metodes izs...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Atzīmē pareizo atbildi!

Kāda būs acc2.balance vērtība pēc transfer metodes izsaukšanas ?

class BankAccount:

    def __init__(self, balance):

        self.balance = balance

    

    def transfer(self, other_account, amount):

        self.balance -= amount

        other_account.balance += amount

acc1 = BankAccount(100)

acc2 = BankAccount(50)

acc1.transfer(acc2, 30)

More questions like this

Want instant access to all verified answers on skola.datorium.eu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome