Last answered:

10 Nov 2022

Posted on:

03 Oct 2022

0

I keep getting attributeError .

Please look at my codes below,

I am just following the solution of the lecturer to understand.But the attribute error I get is stealing the fun I should be having in learning python. Please I need help!



3 answers ( 0 marked as helpful)
Posted on:

03 Oct 2022

1

Hi Martin,

I replicated your code, and I think your error was caused by wrong indentation. Make sure to align all the attributes and methods def, unless they would only be defined inside another method/attribute. In OOP however, I think it's not ideal.

If this helps, you can also help me back by upvoting my answer. It can help me in getting extra XPs.

Kind regards,
Carl

Posted on:

10 Nov 2022

0

Kindly help check my code

Posted on:

10 Nov 2022

0

Hello Gabriel,

I believe the error was caused by how you named the Bank_Account class then you define its class as "BankAccount" without the "_".

Also noticed that your other methods would cause the same error, so just type and use the names consistently to avoid it, i.e., when you define a function "my_function()", you must also call it as is.

Submit an answer

  • Javascript
  • Python
  • Ruby
  • PHP
  • Java
  • C
  • C#
  • C++
  • HTML
  • SQL
  • R