def c(): found = False jobs = input("Enter the job title: ") #right here! jobs = jobs.capitalize() for b in employees: if jobs == b[2]: ## what with the len(i) in these if-statement if len(b)==5: print('%-30s' % (b[4]+ ','+' '+b[3])) found = True if len(b)==6: print('%-30s' % (b[5]+','+' '+b[3]+' '+b[4])) found = True if len(b)==7: print('%-30s' % (b[6]+','+' '+b[3]+' '+b[4]+' '+b[5])) found = True if found == False: print("There is no such job")
When my code doesn't work I don't know why **think** and when my code works I don't know why **think**