names = []
name = input("What is your name")
for x in names:
if x != name:
print("The name is not on the list")
else:
print("The name is on the list")
Is it possible to loop an empty list and if so what is the value output of it when the loop runs? I'm trying to loop the list where if it is empty and the name doesn't match it will print "the name is not on the list" while if it is it will print "the name is on the list".