Aug-17-2020, 02:17 AM
(This post was last modified: Aug-17-2020, 02:18 AM by deanhystad.)
Lines 19 and 21 assign the value None to packs, so line 22 is either going to print "None" for {packs} or it is going to throw a name error because packs is not defined. Do you want to do something like this?
if values[-1] != 'Y': packs = None elif values[-2] == 'Y': packs = cPack[1] else: packs = cPack[0] if packs is not None: print(f"Attendee: {surname}, {firstName}: {packs}")