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
#9
(Jul-08-2017, 08:01 PM)ichabod801 Wrote: Please use python tags, as I requested in my first post.

The problem with checking pin1 == pin is that you are only checking one account. You would have to use a separate if clause for each account. And every time someone added an account you would have to rewrite your code. You need to have some way to search the entered pin to see if matches any account. The dictionary I showed you is one way to do that.

What part of my code don't you understand? The only things I'm using that you aren't are dictionaries and loops. Those are very basic features of the language that you should understand before messing around with classes.

I don't understand your use of dictionaries in the code at all, your code is a bit confusing. Though i think i have found a different way to create a pin checker for this code below:
[python][ def pincheck(self):
pin = input("Enter Pin")
if pin == self.__pin
return True
else:
print("Error try again")
/python]
Sorry i that didn't use the python tag, still getting to grips with this website
Reply


Messages In This Thread
RE: Need help with pseuo -bank account using OOP - by obieze998 - Jul-08-2017, 08:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Different results of code with local account and technical account dreyz64 7 3,760 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