Python Forum
Need help with pseuo -bank account using OOP
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with pseuo -bank account using OOP
#14
Again, this is bad format. You are checking each account's pin, requiring you to repeat code and requiring you to add code every time you add an account.

Your data global is backwards. The pins should be the keys, the accounts should be the values. Then you can see if the pin is in the data (pin in data not pin == data), and get the account out of the data with data[pin]. Then you take that account and run it through ONE set of code that checks for withdrawl or deposit.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Need help with pseuo -bank account using OOP - by ichabod801 - Jul-22-2017, 09:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Different results of code with local account and technical account dreyz64 7 3,791 Mar-05-2020, 11:50 AM
Last Post: dreyz64

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020