I've created a small program which runs like it should but I can't seperate the functions out and get them to work properly. Can the functions getpin(), get menuselection() be sorted out in a specific way so the program runs as normal.
This is running off a seperate class called userdetails
This is running off a seperate class called userdetails
from Details import userdetails
def getpin():
pin_no = ('1111', '2222', '3333')
while True:
pin_no = input("Input the no : ")
if pin_no == '1111' or pin_no == '2222' or pin_no == '3333':
print ("\n Hello and welcome to my program. Please choose from one of the following options:")
break
else:
print ("please try again ")
Tom_Watts = userdetails ('Tom Watts \n' , '\nSidney Stringer School \n\n' 'GCSE English: Grade A \n' 'GCSE Maths: Grade B \n' 'GCSE Physics: Grade A \n', 'GSA LTD', 'Barclays Bank', 'Good')
Bill_Gates = userdetails ('Bill Gates \n ' '81 Oliver St \n ' 'dfdf', '6 gcses', 'CV6 7FR', 'aaa', 'good' )
Steve_McQueen = userdetails ('Steve McQueen \n', '\nArizona High School \n\n' 'GCSE English: Grade A \n' 'GCSE Maths: Grade A \n', 'GSA LTD', 'Lloyds Bank ', 'Average')
dict = {
'1111': Tom_Watts,
'2222': Bill_Gates,
'3333': Steve_McQueen,
}
def getmenuselection():
user = input("\n\n 1. Userdetails \n 2. Education \n 3. Work History \n 4. Bank History \n" ' 5. Credit History \n\n ' )
a = '1'
b = '2'
c = '3'
d = '4'
e = '5'
if user == a:
print (dict[pin_no].Userdetails)
elif user == b:
print (dict[pin_no].Education)
elif user == c:
print (dict[pin_no].Work_history)
elif user == d:
print (dict[pin_no].Bank_history)
elif user == e:
print (dict[pin_no].Credit_history)
getpin()
getmenuselection()
