简体   繁体   English

这个Python代码有麻烦

[英]having trouble with this python code

i get this error and i have tried going through the posts available on stack flow i do not still get the solution. 我收到此错误,我尝试遍历堆栈流中可用的帖子,但仍没有找到解决方案。 this is the code 这是代码

class  BankAccount:
    def  _init_(self,balance):
        self.balance  =  balance
    def  deposit(self,amount):
        self.balance  +=  amount
        return  self.balance
    def  withdraw(self,amount):
        if  amount>self.balance:
            print  "invalid  transaction"
        else:
            self.balance  -=  amount
            return  self.balance
class  MinimumBalanceAcccount(BankAccount):

// this is the error i get: IndentationError: expected an indented block //这是我得到的错误: IndentationError: expected an indented block

Its IndentationError. 它的IndentationError。
complete the class definition. 完成类定义。

class  BankAccount:
  def  _init_(self,balance):
    self.balance  =  balance
  def  deposit(self,amount):
    self.balance  +=  amount
    return  self.balance
  def  withdraw(self,amount):
    if  amount>self.balance:
        print  "invalid  transaction"
    else:
        self.balance  -=  amount
        return  self.balance

class  MinimumBalanceAcccount(BankAccount):
  def __init__(self):
    print "working"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM