Error occurs while running Module 5, Video 1 - Last program | Python Selenium Training - Best Selenium Python Tutorial Online

Selenium Python Training Forum

Error occurs while running Module 5, Video 1 - Last program

G
Gaurav Bharat Post on 16/10/2019

-------------------

Error description:

-------------------

Traceback (most recent call last):
File "C:\Users\heaven1\eclipse-workspace\Module5\module5\import2.py", line 8, in <module>
b.deposit(70)
File "C:\Users\heaven1\eclipse-workspace\Module5\module5\classes.py", line 11, in deposit
self.acccountbalance=self.accountbalance + deposit
AttributeError: 'Banks' object has no attribute 'accountbalance'

Program:

----------------------------

Modulename: Classes.py

----------------------------

class Banks:
def __init__(self,accountbalance):
self.acccountbalance=accountbalance

def deposit(self,deposit):
self.acccountbalance=self.accountbalance + deposit

def withdraw (self,withdraw):
self.acccountbalance=self.acccountbalance - withdraw

def checkbalance(self):
print(self.acccountbalance)

-----------------------------

Modulename: Import2.py

-----------------------------

from module5.classes import *
b=Banks(100)
b.deposit(70)
b.withdraw(50)
b.checkbalance()

G
Gaurav Bharat Reply on 16/10/2019

Able to run it now.

Please mark it as resolved

thanks

G
Gaurav Bharat Reply on 16/10/2019

Able to run it now.

Please mark it as resolved

thanks

S
Sejal Reply on 19/10/2019

Thanks :)