Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #101525

Need help with this asap.

Path csiph.com!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!feedme.news.telefonica.de!telefonica.de!fu-berlin.de!uni-berlin.de!not-for-mail
From ifeanyioprah@yahoo.com
Newsgroups comp.lang.python
Subject Need help with this asap.
Date Tue, 12 Jan 2016 08:48:04 +0300
Lines 20
Message-ID <mailman.43.1452587147.13488.python-list@python.org> (permalink)
Reply-To ifeanyioprah@yahoo.com
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding base64
X-Trace news.uni-berlin.de AyQKQgrTUlrEmh5cksGWqAUxfKOjfmfDCmhwa5gf7nYQ==
Return-Path <ifeanyioprah@yahoo.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.043
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; 'constructor': 0.07; 'subject:help': 0.07; 'subclass': 0.09; 'accordingly.': 0.13; 'def': 0.13; 'assigns': 0.16; 'bankaccount': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'withdrawal': 0.16; 'integer': 0.18; 'to:name:python-list@python.org': 0.20; 'do.': 0.22; '8bit%:5': 0.23; 'skip:m 30': 0.27; '8bit%:3': 0.27; 'class.': 0.30; 'error.': 0.31; 'skip:_ 10': 0.32; 'class': 0.33; '8bit%:4': 0.35; 'should': 0.36; 'to:addr:python-list': 0.36; 'method': 0.37; 'takes': 0.39; 'to:addr:python.org': 0.40; 'subject:with': 0.40; 'still': 0.40; 'called': 0.40; 'from:no real name:2**0': 0.60; 'deposit': 0.61; 'subject:Need': 0.61; 'balance': 0.64; 'header :Reply-To:1': 0.67; 'reply-to:no real name:2**0': 0.71; 'subjectcharset:utf-8': 0.71; 'subject:this': 0.85; 'received:98.138.226': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1452577686; bh=W8wXpn3vwFtlIKAEFtFE2qbHKxO32ro8nSwxNjayY3c=; h=From:To:Subject:Date:Reply-To:From:Subject; b=L9v2w3HmTnkezAw6rs3MDW0GoA7TAMd/SCauhl9SJcjyNlktwsVwW9Iy0j5ChvoiBlIeCqhDNGqiDWhK5pQxGRZm0SErX5c9luzbQdhsFW9SsjGKA4btWjN2U+btDE2CvyB+/x7VEQ/NZqVfwWtneVCLd5GhXaEQI/295Zagb/Lrn3SBS/caDGb7COTBSPXyveV7EVHX/aiDi1I8EEWTfMAfZBXb1im0yOsLTvHINQvlgLcRvyprhuGWB6dwAT1/sXO9sG4cakGBpFeR4wGT22RS4pQqLRlzbArho/BTLw6SOV/hAIfvKFqbj5WS4JEbaMg5Mi5q812XXMA+O8Cwnw==
X-Yahoo-Newman-Id 660019.57525.bm@smtp209.mail.ne1.yahoo.com
X-Yahoo-Newman-Property ymail-3
X-YMail-OSG HCWUBTkVM1mA_wK31HWQyjjSKLtEsv.F7EOAMZqN0xzmepW ZZBuEnr.DUDmsrAmVm9IYqePOF.NLNx8PvbqeFIIhHTPIQhZFGEmKgBaWErf 7qLN4R1OdoBUT8Ib6NfV3aq_oHkBUUVSmvnM2RPNRG2yhcmLLdaP3K_0F3XR aLJGZHtMASr2dt12uQzxFwuvo406oQYE2W89JkmCCTbwykDDDthAuiMZWsBE WzP1cSYQDCD5fDetl6RT5fXF7nxLTKlMozQ4rk3ISkDqcblemsm4qqb.0U9s pw1JxFL5ykD4m6Aa6UHLkUDzVY7unNXrPwBRBixU_0..drqGToPXU_yFG9Yy 46D_ejD3VecS38k9B4oCWhYTovsFtQtzrZyyCrKE.lHtxczFnseWbnGchR5m URFxPuG2ctuJhWFdaHh6rDRmLBNrdla8Wzuw0SqkL7DUem8TiV84wfkW0QxQ DL3GL.WZWHwzq7SHxLriw_kd6SjWAm9nKagHuP142AC3qXNC.7XAscNNH7yi 5hvoS
X-Yahoo-SMTP nvpq5pGswBCnV1oqgkwAqPgSq3K9V0gXEQ--
X-Mailer Mail.Ru Mailer 1.0
X-Originating-IP [66.228.60.219]
X-Letter-Fingerprint F6kuWgP1Qjvm8WrK6gIvavBvlFgbbhm7
X-Priority 3 (Normal)
X-Mras Ok
X-Spam undefined
X-Mailman-Approved-At Tue, 12 Jan 2016 03:25:45 -0500
X-Content-Filtered-By Mailman/MimeDel 2.1.20+
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:101525

Show key headers only | View raw


Create a class called BankAccount
Create a constructor that takes in an integer and assigns this to a `balance` property.
Create a method called `deposit` that takes in cash deposit amount and updates the balance accordingly.
Create a method called `withdraw` that takes in cash withdrawal amount and updates the balance accordingly. if amount is greater than balance return `"invalid transaction"`
Create a subclass MinimumBalanceAccount of the BankAccount class.
This was my solution and I still got error. What should I do.
class BankAccount: 
    def __init__(self, initial_amount): 
        self.balance = initial_amount 
    def deposit(self, amount): 
        self.balance += amount 
    def withdraw(self, amount): 
        if self.balance>= amount: 
            self.balance  -=  amount 
        else: 
          print('invalid transaction') 
a1 = BankAccount (90) 
a1.deposit(90) 
a1.withdraw(40) 
a1.withdraw(1000) 
class MinimumBalanceAccount(BankAccount): 
    def __init__(self): 
        BankAccount.__init__(self) 

Please help me.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Need help with this asap. ifeanyioprah@yahoo.com - 2016-01-12 08:48 +0300

csiph-web