Aug-26-2019, 08:31 AM
I would do it this way:
husbands = [('ginny', 'harry'), ('eve', 'adam'), ('lizzy', 'darcy'), ('rose', 'jack')] name = input('write wife name here = ') found = False for wife, husband in husbands: if name == wife: print(f'{wife}´s husband is {husband}') found = True if not found: print(f'{name} might be single as she is not in the list')