archive= ['Frederick the Great',
'Ivan the Terrible',
'maurice Of Nassau',
'Napoleon BONAPARTE']
n=[]
n2=[]
n3[]
for line in archive:
n.append(line)
for x in n :
lw = x.lower()
for i in lw.split() :
n2.append(i)
for i in n2 :
if i == 'of' or i == 'the' :
i=i.lower()
n3.append(i)
else:
i=i.capitalize()
n3.append(i)
print(n3)
this code prints the names as strings, how could .join() be used to do that or using some other method making so that the output would be words in the names are capitalized, the and of are in lowercase and together.
PS:Still new to programming sorry for any mistakes in the formulation of the question.