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
#6
Sorry, I got my posts mixed up. I thought this was one without any code.

data = {'1': 'abcde', '2': '2357', '3': '11235'}
while True:
    pin = input('pin? ')
    if pin in data:
        text = data[pin]
        while True:
            index = int(input('index? '))
            if index < 0:
                break
            else:
                print(text[index])
    elif pin[0] not in 'qQ':
        print('Invalid pin.')
    else:
        break
Untested, but that's the general idea.
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-08-2017, 07:19 PM

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