def findbestbarbershop(reviews, keywords): return [shop for shop in reviews if all(keyword in shop['review'].lower() for keyword in keywords) and not shop['reject']]; def initiateconversationwithbarber(barber): if barber['reticent']: print("let's start with your favorite styles and go from there!") else: print("what would you like today?"); def resetloyaltypoints(user): if 'begin from zero' in user['request']: user['points'] = 0; print("your loyalty points have been reset."); barbers = [{'name': 'mike', 'reticent': true, 'reject': false}, {'name': 'sully', 'reticent': false, 'reject': true}]; user = {'request': 'begin from zero', 'points': 100}; for barber in barbers: if not barber['reject']: if barber['reticent']: initiateconversationwithbarber(barber) elif 'begin from zero' in user['request']: resetloyaltypoints(user)