a= ['Emre', 'Hacettepe', 'University', 'Computer', 'Engineering']
b= ['Kerem', 'METU', 'Architecture']
c= ['Leyla', 'Ankara', 'University', 'Physics']
d= ['Sami', 'Bilkent', 'University', 'Civil', 'Engineering']
#S=input list that i wrote as argument but i didn't add here all the codes because it is too long.Etc input: Emre,Ahmet
x=len(S)
for i in range(0,x):
list=[]
if a[0]== S[i] :
print('Name: '+ (a[0])+', University: '+a[1]+' '+a[2]+','+a[3]+' '+a[4],end=' ')
list.append(S[i])
if h[0]== S[i]:
print('Name: '+ (h[0])+', University: '+h[1]+' '+h[2]+','+h[3]+' '+h[4],end=' ')
list.append(S[i])
if e[0]==S[0]:
print('Name: '+e[0]+', University: '+e[1]+','+e[2],end=' ')
list.append(S[i])
if f[0]==S[i]:
print('Name: '+f[0]+', University: '+f[1]+' '+f[2]+','+f[3],end=' ')
list.append(S[i])
if a[0] or h[0] or e[0] or f[0]!= S[i] and S[i] not in list:
print('No record of '+"'"+S[i]+"'"+' was found!',end=' ')
In last 'if' statement I just only want to write the nonexisting ones but i am receiving an wrong output.
Name: Emre, University: Hacettepe University,Computer Engineering No record of 'Emre' was found! No record of 'Ahmet' was found!
No record of 'Emre' shouldn't be in the output. Where is my mistake?