Beginner, Python

Can someone please explain why my final print is printing twice?

data inputs
print("Welcome to Test")
fn = input('First name: ')
ln = input('Last name: ')
#data search
xan = fn , ln
dan = list(xan)
man = dan[0]
for j in dan:
	print('Olay, Found.')

Hello there,

Because you are looping over each element of dan. Print out dan to see why:


Hope this helps

1 Like

Oh okay. Thank you. it does help please