Display user detail utility I currently have a utility that will display details about a list of specified users. In its current state I don't use any functions, which I've noticed make it a little more repetitive than I would like.
I'm specifically interested in how to make this more functional, but I'd be interested in any suggestions for how to make this better.
Details.py
class userdetails:

    def __init__(self, Userdetails, Education, Work_history, Bank_history, 
    Credit_history):
        
        self.Userdetails = Userdetails
        self.Education = Education
        self.Work_history = Work_history 
        self.Bank_history = Bank_history

My other file
from Details import userdetails


pin_no = ('1111', '2222', '3333')


while True:

   pin_no = input(&quot;Input the no : &quot;)

   if pin_no == '1111' or pin_no == '2222' or pin_no == '3333':


       print (&quot;\n Hello and welcome to my program.  Please choose from one of the following 
options:&quot;)

       break

else:

    print (&quot;please try again &quot;)


    
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 ', '\nBinley Woods School \n\n' 'GCSE Maths: Grade A \n', 
'MI6', 'Bank of England', '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, 

}


user =  input(&quot;\n\n 1. Userdetails \n 2. Education \n 3. Work History \n 4. Bank History \n&quot; ' 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)
The code could be simpler and more Pythonic. For example:
pin_no = ('1111', '2222', '3333')


while True:

   pin_no = input(&quot;Input the no : &quot;)

   if pin_no == '1111' or pin_no == '2222' or pin_no == '3333':

could simply be:
valid_pins = ('1111', '2222', '3333')
pin_no = input(&quot;Input the no : &quot;)
if pin_no in valid_pins:

Thus avoiding repetition.
This code:
user =  input(&quot;\n\n 1. Userdetails \n 2. Education \n 3. Work History \n 4. Bank History \n&quot; ' 5. 
Credit History \n\n  '  )

could become:
str = (&quot;Userdetails&quot;, &quot;Education&quot;, &quot;Work History&quot;, &quot;Credit History&quot;)
for num, value in enumerate(str, start=1):
    print(f&quot;{num}) {value}&quot;)

user = input(&quot;Choose an option: &quot;)

which gets you output like this: (note that I use enumerate for automatic line numbering)

1) Userdetails
2) Education
3) Work History
4) Credit History
Choose an option: 

The problem with this code is that your data is polluted with linebreaks. Just don't. The formatting can be done in your code. For example the join function can easily break down a tuple:
print(&quot;\n&quot;.join(str))


Userdetails
Education
Work History
Credit History

As it stands your class is underutilized. Instead of this:
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')

I would strongly advise to use keywords arguments like this:
Steve_McQueen = userdetails (education='Arizona High School', work_history='GSA LTD', bank_history='Lloyds Bank')

First of all, it is more clear what the values relate to. And then you can provide arguments in the order you want (so your code won't break if you insert new arguments in the future, or change their order).
Reference: Positional and Keyword Arguments
Note that by convention Python variables should be lowercase.
I am not sure the class is beneficial here. You could simply make up a dict of all users. That depends on the ultimate purpose. As an example:
people = {
    '1111': {
        'name': 'Tom Watts',
        'education': 'Sidney Stringer School',
        'grade': 'GCSE English: Grade A'
    },
    '2222': {
        'name': 'Bill Gates',
        'education': 'Binley Woods School',
        'grade': 'GCSE English: Grade A'
    },
    '3333': {
        'name': 'Steve McQueen',
        'education': 'Arizona High School',
        'grade': 'GCSE Maths:   Grade A'
    }
}

Then:
&gt;&gt;&gt; people['2222']['name']
'Bill Gates'
&gt;&gt;&gt; people['2222']['education']
'Binley Woods School'

And then, provided that your dict is defined beforehand, the list of valid 'pins' can be built automatically:
# list comprehension
valid_pins = [k for k in people.keys()]

# what the list comprehension returns:
[k for k in people.keys()]
['1111', '2222', '3333']

No need for hardcoding numbers.
Thus, you could do something like this:
# list comprehension: get the list of valid pins from dict 'people' defined above
valid_pins = [k for k in people.keys()]

while True:
    pin_no = input(&quot;Input the no : &quot;)
    if pin_no not in valid_pins:
        print (&quot;please try again &quot;)
    else:
        # show details of matching user
        print(people[pin_no])